bash - awk compare two files -erase row from second file from condtion of first file -
i need help.
first file
0.5 0.4 0.1 0.6 0.9 second file .bam (i have use samtools view)
aaaa bbbb cccc aaab bbaa ccaa hoho jojo toto sese rere baba jouj douj trou and need output:
aaaa bbbb cccc aaab bbaa ccaa sese rere baba condition: if $1 first file in <0.3;0.6> print same row second file, if not, erase it. want filtrate second file condition of first file. prefer awk or bash code, not important.
condition first file:
awk '{if($1>0.3 && $1<0.6) {print $0}}' please me? lot
here 1 awk solution:
awk 'fnr==nr {a[nr]=$1;next} a[fnr]>0.3 && a[fnr]<0.6' firstfile secondfile aaaa bbbb cccc aaab bbaa ccaa sese rere baba not printed since <0.6 , not <=0.6
Comments
Post a Comment