in reply to Re: Merging files, 1 line for every 10
in thread Merging files, 1 line for every 10
open my $in_fh1, '<', $in_file1; open my $in_fh2, '<', $in_file2; open my $out_fh, '>', $out_file; while (defined(my $line1 = <$in_fh1>)) { print {$out_fh} $line1; unless ($. % 10) { my $line = <$in_fh2>; print {$out_fh} $line; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Merging files, 1 line for every 10
by Kc12349 (Monk) on Sep 07, 2011 at 22:13 UTC | |
by GrandFather (Saint) on Sep 08, 2011 at 20:51 UTC |