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  
Administrator
 
Join Date: Jul 2012
Last Activity: 13 December 2017, 3:56 AM EST
Location: San Jose, CA, USA
Posts: 10,772
Thanks: 590
Thanked 3,771 Times in 3,219 Posts
Quote:
Originally Posted by MadeInGermany View Post
Most easy: at the beginning of the awk script put

Code:
/^#/ { 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:

Code:
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)