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: 23 February 2018, 6:37 AM EST
Location: San Jose, CA, USA
Posts: 11,083
Thanks: 618
Thanked 3,864 Times in 3,306 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)