Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

How do I count strings on each line?

$
0
0
Hi

Im a very inexperienced bioinformatician

I have a large DNA file with about 10000 lines of sequence and need to count the occurrence of TA for each line

for example in the file

Code:

TACGCGCGATA
TATATATA
GGCGCGTATA

I would like to get an output like:

Code:

2
4
2

I have tried various grep and awk commands but can only get total number of TA in the whole file

many thanks

Viewing all articles
Browse latest Browse all 16232

Trending Articles