I want to match two file using grep and awk. Here is Data1 and Data2. I want to get overlap only if the following is true:
$1(Data1)==$1(Data2) && $3(Data1)==4(Data2)
Data1:
I929_79_46226_x388 GCAAAGCACACGGCCTGC 10
I929_79_145232_x1 TAGCAGCGGGAACAGTTC 11
Data2:
I929_79_145232_x1 15 1..15 11 134452384 46542640..46542654 5.8 1.00 30.2 Plus / Plus
I929_79_145232_x1 15 1..15 3 199501827 171473603..171473617 5.8 1.00 30.2 Plus / Plus
I929_79_46226_x388 15 1..15 10 242951149 168261508..168261522 5.8 1.00 30.2 Plus / Plus
I929_79_145232_x1 15 1..15 2 242951149 226319033..226319047 5.8 1.00 30.2 Plus / Plus
I929_79_145232_x1 15 1..15 1 247249719 92080967..92080981 5.8 1.00 30.2 Plus / Plus
$1(Data1)==$1(Data2) && $3(Data1)==4(Data2)
Data1:
I929_79_46226_x388 GCAAAGCACACGGCCTGC 10
I929_79_145232_x1 TAGCAGCGGGAACAGTTC 11
Data2:
I929_79_145232_x1 15 1..15 11 134452384 46542640..46542654 5.8 1.00 30.2 Plus / Plus
I929_79_145232_x1 15 1..15 3 199501827 171473603..171473617 5.8 1.00 30.2 Plus / Plus
I929_79_46226_x388 15 1..15 10 242951149 168261508..168261522 5.8 1.00 30.2 Plus / Plus
I929_79_145232_x1 15 1..15 2 242951149 226319033..226319047 5.8 1.00 30.2 Plus / Plus
I929_79_145232_x1 15 1..15 1 247249719 92080967..92080981 5.8 1.00 30.2 Plus / Plus