I want to count the number of times 1.1 appears within my fastq file. It should only appear once every 4 lines (on the first line). I have been using:
grep -o '1.1' ./seqtk_1/subsample_1/new_sub_NC_001539_1.fq.gz |wc -l
This telling me it occurs 1046902 times, which is 46902 more times than I expected.
It appears to be including these characters in its count: 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 1/1
How do I search the file for specifically 1.1? Or searching just the first time each set of 4?
I have tried using -v on grep
Thanks
I have used this code:
This returns the number I wanted. But it also says:
Is it doing what I want it to do?
No:
awk 'NR%4==1' ./seqtk_1/subsample_1/new_sub_NC_001539_1.fq.gz | grep -c '1\.1'
try -F instead of -o