in reply to Re^7: inserting array of data into text file
in thread inserting array of data into text file
open (FILE, "<$file"); open (OUT, ">TRUE_OUTPUTS"); open (FILE2, "<$file2"); open (OUT2, ">COMPARE"); while (<FILE>) { chomp $_; if ($_ =~ m/^\d\s+\d/) {print OUT "$_\n"} } close (FILE); while (<FILE2>) { chomp $_; push @col, $_ =~ m/(\S+\s+\S+)/; } close (FILE2); $size = scalar @col; print $size; open(COL, "<TRUE_OUTPUTS"); while(<COL>) { chomp $_; $_ =~ s/(\S\s+\S)/$1 $col[$i++]/; print OUT2 "$_\n"; } close(COL); close(OUT2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: inserting array of data into text file
by ysth (Canon) on Jul 13, 2004 at 20:54 UTC | |
by Anonymous Monk on Jul 13, 2004 at 21:10 UTC | |
by ysth (Canon) on Jul 13, 2004 at 21:28 UTC |