Thread Dateien durchsuchen
(29 answers)
Opened by Paul at 2013-01-30 21:28 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 my %b_lookup; for (<$file_b>) { my ($num, $data) = split(/ /, $_, 2); $b_lookup{$num} = "$num $data"; } for (<$file_a>) { my ($num, $data) = split(/ /, $_, 2); if (exists $b_lookup{$num}) { print $file_c $b_lookup{$num}."\n"; } else { print $file_c "$_\n"; } } Die Filehandles müssen noch geöffnet, geschlossen werden. Prognose: Läuft unter 5 sek. 1 + 1 = 10
|