Entering edit mode
6.7 years ago
zshores
•
0
I need to extract a few whole rows from a large sam file, based on column 4. I have been trying to extract it by awk, but to no avail. Anyone able to tell me where I am going wrong?
Looking to extract column 4 with either 76563 or 115625 in it and put it in the output file. The file is of course tab delineated.
samtools view practice.sam | awk -F' ' '$4/76563||115625' output.sam
Awesome thanks so much! Why is the print statement needed still/separate from the main statement? Is the OFS an alternate form of -F?
OFS
is the output field separator,-F
is the input field separator. You can often skip an explicitprint
, but being able to and it being a good idea are completely unrelated things.