halley,
Just to extend your very correct comment a little further:
#!/usr/bin/perl -w
use strict;
use Text::CSV;
my $csv = Text::CSV->new;
open (INPUT,"input.txt") or die "\nCan't open input.txt for reading :
+$!\n";
open (OUTPUT,">output.txt") or die "\nCan't open output.txt for writin
+g : $!\n";
select OUTPUT;
while (<INPUT>) {
$csv->parse($_);
my @IF = $csv->fields();
foreach my $element (@IF) {
#printf command goes here
}
print "\n";
}
Of course printf may truncate fields that are too short long and there
are more programmer efficient ways to do the printf. I was just
using this syntax for readability purposes.
Cheers - L~R |