Continued from before...Now I'm trying to understand the parsed version
BEGIN { $/ = ">"; $\ = "\n"; }Not sure, but does this statement define the boundaries of each line? Start with a carat and end with a new line.
LINE: while (defined($_ = <ARGV>)) { chomp $_;
Setting up the while loop, what does $_ = <ARGV> mean?
our(@F) = split(' ', $_, 0); next unless @F;
This sets the array F and splits it at each whitespace, and two other terms I dont know. What does next unless @F mean?
s/length=// foreach ($F[1]);This code clears the length= string from every first column in the array.
@F[5] = join('', @F[5..99]);This joins any columns past 5-99 with column 5
$#F = 5;Don't know? Does this turn the array into a scalar variable set to 5 columns?
print '>', join(',', @F);This is the print statement, printing the carat. Then you join each column of the array by a comma?
In reply to Re^4: Perl script help to convert .txt file to .csv
by Seabass
in thread Perl script help to convert .txt file to .csv
by Seabass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |