lynxct has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl -w use strict; open (FILE1,"Largedatafile.txt"); open (FILE2,"Smalldatafile.txt"); open (FILE3,"addressfile.txt"); while(<FILE2>) { ($var1, $var2, $var3,$var4,$var5)=split(/\t/, $_); { while(<FILE1>) { ($id1, $id2,$id3)=split(/\t/,$_); while(<FILE3>) { ($citycode, $statecode,$zipcode)=split(/\t/,$_); if (($id3 != $var3) & ($citycode !=$var5)) { print "$var1\tid1\n"; } } } } } close (FILE1); close (FILE2); close (FILE3);
20060712 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
2006-07-12 Retitled by Corion, as per Monastery guidelines
Original title: 'text files'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing text files
by Fletch (Bishop) on Jul 11, 2006 at 21:10 UTC | |
|
Re: Comparing text files
by swampyankee (Parson) on Jul 11, 2006 at 21:52 UTC | |
by lynxct (Initiate) on Jul 12, 2006 at 02:59 UTC | |
by graff (Chancellor) on Jul 12, 2006 at 06:21 UTC |