in reply to arrange output in columns
Update:Working version :-)
It's a slow day....use strict; use warnings; use English; # let's talk like pirates.... my @arr; my $fc = 0; for my $file (@ARGV) { open my $fh, "<$file" or die "We're screwed with $file"; while (<$fh>) { chomp; # maybe s/\s+$// ? $arr[$INPUT_LINE_NUMBER][$fc] = $_; } close $fh; $fc++; # inc filecount } # print for (my $i =1; $i <= $#arr; $i++) { # fill in the blanks print join(',', map { $arr[$i][$_] // '' } 0..$fc-1)."\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: arrange output in columns
by poj (Abbot) on Jun 18, 2013 at 14:39 UTC | |
by space_monk (Chaplain) on Jun 18, 2013 at 15:20 UTC |