I have two text files.
My first text file looks like this:
2 3
5 9
The second text file looks like this:
4 2 3
3 6 2
1 5 9
I'm trying to separate lines where the values of columns 2 and 3 in the second file have the same values as those in columns 1 and 2 of the first text file.
I'm trying this script but I'm currently not successful and the output is empty.
set a=`awk '{print $1}' 1.txt`
set b=`awk '{print $2}' 2.txt`
set cc=1
foreach ii ($a)
awk '($2==$a[$cc] && $3==$b[$cc]) {print$0}' 2.txt >> output.txt
@ cc++
end
Can someone help me with this?