Feed on
Posts
Comments

to count the number of times you match a substring in a larger text file, you can use the following shell one-liner:

>> sed “s/[sub_str]/[sub_str]\n/g” [text_file] | wc -l

Stumble it!

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

Did I get this wrong? Let me know!

Trackback URI | Comments RSS

More blogs about http://desk.stinkpot.org:8080/tricks.