All,
I have 2 files - SC and ID. in ID, I have just 2 columns separated by a whitespace. In SC, there are many more columns but might have a pair present in ID.
for e.g.
ID
chain_0 123
chain_1 456
chain_2 789
SC
chain_0 123 toronto ontario canada
chain_1 456 toronto New Delhi India
chain_2 789 housing_crisis mortgage_rates first_time_buyers miserable
No I want to print lines in SC matching the pair in ID. I tried following but this doesn't work.
open(ID, '<', $id) or die $!;
while(<ID>){
my @array = split ' ', $_;
$output = `awk '\$1 ~ /\<$array[0]\>/' scan_cells | awk '\$2 ~ /\<$array[1]\>/'` ;
print "$output";
}
close(ID);
Thanks!!1