Daredevil-- has asked for the wisdom of the Perl Monks concerning the following question:
And file2.txt file:1173|0040 1174|052425 1175|052634 1176|053281 1177|055876 1188|2222 1189|2002 1190|2002 1191|2002
So that in the second column of the file1.txt and third column of the file2.txt is the data that could be equal, I want to compare000|20019|0040|No Definida. 000|20034|052425|No Definida. 000|20014|052634|No Definida. 000|20031|053281|No Definida. 000|20044|055876|No Definida. 000|67022|2000|No Definida. 000|67022|2000|No Definida. 000|00019|2000|No Definida. 000|67024|2000|No Definida. 210|72059|2002|SERGIO SUAREZ LLAMAS 210|72059|2002|SERGIO SUAREZ LLAMAS 210|72059|2002|SERGIO SUAREZ LLAMAS 210|20023|2002|SERGIO SUAREZ LLAMAS 210|72057|2002|SERGIO SUAREZ LLAMAS 210|67013|2002|SERGIO SUAREZ LLAMAS
But I don't know how to compare the filesforeach my $line (@fuente) { my @parts = split /\|/, $line; print join("|", @parts[2]), "\n"; } foreach my $line (@fuente2) { my @parts = split /\|/, $line; print join("|", @parts[3]), "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How compare two files
by Roy Johnson (Monsignor) on May 07, 2004 at 20:12 UTC | |
|
Re: How compare two files
by graff (Chancellor) on May 11, 2004 at 03:06 UTC | |
|
Re: How compare two files
by Nkuvu (Priest) on May 07, 2004 at 20:03 UTC |