[dot] PATH
A blog dedicated to my Linux experience and other great tools.
Thursday, April 14, 2011
More useful Unix one line scripts
Goal: Take the 9th column of the document and count all of the lines that have a semicolon.
cat document.txt | cut -f9 | egrep ';' | wc -l
Goal: count the number of columns in a text.
head -1 document.txt | awk '{print NF}'
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment