in reply to Compare 2 files and get data

Hi:
Perhaps you wold have to use two while nested. In pseudocode, what i've think that you could use is:
while (<file1>){ $line1=$_ while(<file2>){ $line2=$_ foreach $field1 in $line1 foreach $field2 in $line2 if $field1 eq $field2{ print $field1 } } } } }

It compare each field in file1 with each field in file2.
If what you want is that the two fields will be in the same line, then you could use, with only one while:
while (<file1> or <file2>){ #The longest of the two files $line1=read ($file1); $line2=read ($file2); foreach $field1 in $line1 foreach $field2 in $line2 if $field1 eq $field2{ print $field1 } } } }
I hope that this pseudocode will help you
Yours sincerelly,
José Ramón Martínez