Computing.Net > Forums > Unix > awk script help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

awk script help

Reply to Message Icon

Name: ayon
Date: December 1, 2007 at 01:01:00 Pacific
OS: Solaris2
CPU/Ram: UltraSPARC III / 2048M
Product: SunBlade2000
Comment:

I have a file which has 2 lines of header information then a series of columns that are seperated by whitespace. How do I use awk to read this file, skip the header lines, extract columns 1, 2, 5 and then output these columns to a new file?




Sponsored Link
Ads by Google

Response Number 1
Name: fpmurphy
Date: December 1, 2007 at 02:38:53 Pacific
Reply:

Try:

{
if ( NR > 2 ) { print $1, $2, $5 }
}


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: awk script help

awk script help www.computing.net/answers/unix/awk-script-help/5596.html

tweaking William's awk script www.computing.net/answers/unix/tweaking-williams-awk-script/5174.html

awk call other awk script? www.computing.net/answers/unix/awk-call-other-awk-script/5574.html