I need to find multiple patterns in a file with awk, and count them. I don't want to write these patterns manually. I would like to know if it possible to create a "searching patterns loop" ?
The file which contains the patterns is (I only look for the even lines) :
>bc1001_5p
CACATATCAGAGTGCGTGGATTGATATGTAATACGACTCACTATAG
>bc1001_3p
CACATATCAGAGTGCGTCTCAGGCG
>bc1002_5p
ACACACAGACTGTGAGTGGATTGATATGTAATACGACTCACTATAG
>bc1002_3p
ACACACAGACTGTGAGTCTCAGGCG
>bc1003_5p
ACACATCTCGTGAGAGTGGATTGATATGTAATACGACTCACTATAG
>bc1003_3p
ACACATCTCGTGAGAGTCTCAGGCG
>bc1004_5p
CACGCACACACGCGCGTGGATTGATATGTAATACGACTCACTATAG
>bc1004_3p
CACGCACACACGCGCGTCTCAGGCG
I would like something like that :
awk '/the loop with all the patterns/ {count++} END{print count}' the_file_where_I_look_for_those_patterns
Thanks