For instance, I have the following in a tab separated text file with two columns:
blah ABC_DE_23154_e53G_12 blah DEF_GH_23165_f35H_36 blah CED_BF_56412_c56T_21
I am using the following awk script to extract the lines that matches the third number in the second column falling in a specific range (between 23153 and 23167) after the second underscore (which doesn't work):
awk -F "_" '$2>23153 && $2<23167' *.txt >> output.txt
Output inside the "output.txt" file should be:
blah ABC_DE_23154_e53G_12 blah DEF_GH_23165_f35H_36
I have around 600 text files with around 8000 lines of data in each file.