Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Counting no of '>' symbol in a file

by stevieb (Canon)
on Aug 31, 2015 at 14:39 UTC ( [id://1140541]=note: print w/replies, xml ) Need Help??


in reply to Counting no of '>' symbol in a file

Because you're counting the number of lines and not the character count per line (per choroba stating that a fasta file will only have one '>' per line), grep will work.

perl -E 'say scalar grep />/, <>' file

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1140541]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-28 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found