Unix/Linux Go Back    

Extract information from file

Shell Programming and Scripting

Kindly Note - This is a Single User Post by Forum Member Don Cragun Regarding:
Extract information from file.
Please Follow The Primary Link Above to View the Full Discussion.

Old Unix and Linux 05-15-2017   -   Original Discussion by vedanta
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is offline Forum Staff  
Join Date: Jul 2012
Last Activity: 20 June 2018, 11:28 AM EDT
Location: San Jose, CA, USA
Posts: 11,324
Thanks: 640
Thanked 3,944 Times in 3,371 Posts
Originally Posted by MadeInGermany View Post
Most easy: at the beginning of the awk script put

/^#/ { next }

It will skip the following code whenever a #comment is met.
Note that it can't quite be at the beginning of the script... It has to come after:

awk ' NR==1 {
                        print "File      | Jobname |  node  | pfile               | metafile            | tname | priority | delay" # to be replaced by tab

or you won't get the desired heading line in your output file.
The Following User Says Thank You to Don Cragun For This Useful Post:
MadeInGermany (05-15-2017)