//View Tip #818
Similar Tips
» Version all unversioned files in an SVN checkout
» Counts files in the current directory and subdirectory
» Convert seconds to Hours, Minutes and Seconds
» SVN resolve all conflicts
» Kill matching processes without unnecessary greps and extra sh p

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
The awk command below will print out the first line of each paragraph in a file. Paragraphs must be separated by a blank line for this to work.

awk 'NR==1||cnt-->0;/^$/{cnt=1}' file.txt


View Comments »




Comments 

Add your comment

Comments are currently disabled
No Comments

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit