in reply to Merging larges files by columns
If think you want something like this. (untested)
open my $OUTFILE, ">", "outfile.csv" or die "oh noo: $!"; open my $IN1, "<", "infile1.csv" or die "bummer1: $!"; open my $IN2, "<", "infile2.csv" or die "bummer2: $!"; while (<$IN1>){ chomp; print $OUTFILE $_; my $line2 =<$IN2>; chomp $line2; my @f = split/,/, $line2; print $OUTFILE ",$f[1]\n"; } close $IN2 or die $!; close $IN1 or die $!; close $OUTFILE or die $!;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Merging larges files by columns
by Kc12349 (Monk) on Sep 16, 2011 at 21:06 UTC |
In Section
Seekers of Perl Wisdom