Computing.Net > Forums > Unix > get value of 200th field by awk

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.

get value of 200th field by awk

Reply to Message Icon

Name: sivakarthik
Date: October 6, 2005 at 09:47:28 Pacific
OS: Unix
CPU/Ram: 512MB
Comment:

Hi,
I'm not able to get the value of 200th field using awk. Can you please help me

Thanks
Siva

Hi,
I'm trying to replace a column in a comma seperated file with a column in another file using sed/awk. Can anyone help me.

Thanks
Siva




Sponsored Link
Ads by Google

Response Number 1
Name: sivakarthik
Date: October 6, 2005 at 10:21:32 Pacific
Reply:

awk -F['|'] '{print $200}' GMS.txt
gave the following error

awk: The field 200 must be in the range 0 to 199.

please help.

Thanks
Siva

Hi,
I'm trying to replace a column in a comma seperated file with a column in another file using sed/awk. Can anyone help me.

Thanks
Siva



0

Response Number 2
Name: Jim Boothe
Date: October 6, 2005 at 10:50:09 Pacific
Reply:

I specified a delimiter that I knew would not exist in my file so that awk would see the lines as having only one long field (to prevent the abort). Then I split the lines into my own array and printed the 200th array slot.

awk -F: '{split($0,f," ");print f[200]}' infile


0

Response Number 3
Name: sivakarthik
Date: October 7, 2005 at 01:19:42 Pacific
Reply:

Great, that helps. Thanks Jim.

Siva

Hi,
I'm trying to replace a column in a comma seperated file with a column in another file using sed/awk. Can anyone help me.

Thanks
Siva



0

Sponsored Link
Ads by Google
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: get value of 200th field by awk

Get rid of the leading space www.computing.net/answers/unix/get-rid-of-the-leading-space/4513.html

Return value of awk www.computing.net/answers/unix/return-value-of-awk/7172.html

Removing spaces added by awk www.computing.net/answers/unix/removing-spaces-added-by-awk/8073.html