I did something like you want, and maybe this could help you !!!!!!!. I copy my code. foreach my $linea1 ( <ARRAY1> ) { my $match = 0; my @comp = split /\|/, $linea1; foreach my $linea2 ( <ARRAY2> ) { my @comp2 = split /\|/, $linea2; # I use the pipe in my file but you can put a white space. if ( $comp[2] == $comp2[0] ){ $match=1; } # You have to put the lines you want to compare in both files. } if ( $match == 1 ){ print WRITE join("|", @comp[2,3,0], "\n"); } } Regards ----- Original Message ----- From: Alden Meneses <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: help on comparing lines in a text file Date: Mon, 11 Oct 2004 22:57:51 -0700 > > so i have a text file that looks like this > > 10/04/2004 UPL TZOO CME CRDN WIBC PETD SMF > 10/11/2004 UPL TZOO CME WIBC PETD VNBC AMED > > anyway each line has 1 date field and 100 stock symbols and they are > in order. I am trying to compare the different lines to see what has > changed. > > so I open the file and put the <FH> into an array > @array=<FH>; > > but $array[0]; = line 1 and $array[1]; = line 2. > > i keep thinking that i need to break down the array into each line and > match a symbol to an array so that $array[0] = 10/04/2004 and > $array[1] = UPL then compare it to the 2nd line somehow but don't > think I am thinking this problem out correctly. > > can someone help with my logic? > > tnx in advance, > alden > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- _______________________________________________ Get your free email from http://mymail.bsdmail.com
Powered by Outblaze -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>