http://www.perlmonks.org?node_id=1004114


in reply to Re^4: raw data formatting
in thread raw data formatting

What do the indexes look like, i.e., how do they appear in your file?

Noticed that line "F" doesn't wrap if it's the very last DATA line, since it doesn't have a newline at it's end. Thus, make the following two changes and I'll do the same in the original posting:

while ( chomp( my @lines = $it->() ) ) {

and

print for map { s/\s+/$letter++ . ' '/e; "$_\n" } @lines;

Remove the print "\n"; line.