Computing.Net > Forums > Linux > grep? test?

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.

grep? test?

Reply to Message Icon

Name: kkhung
Date: October 10, 2004 at 06:54:28 Pacific
OS: win2K
CPU/Ram: 768
Comment:

I have a text file with input like
Line 1 "0021", "0023"
Line 2 "0021", ""
obtained after 'cut'
May I know how I can test, using shell script whether which line has the second field null? Thanks in advance..



Sponsored Link
Ads by Google

Response Number 1
Name: Wolfbone
Date: October 10, 2004 at 10:58:25 Pacific
Reply:

There are lots of ways, the simplest is probably awk -F, '$2=="" {print FNR}' but it depends what you want to do.


0
Reply to Message Icon

Related Posts

See More


kdevelop makefile Give User root-like Priv ...



Post Locked

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


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: grep? test?

A couple of Linux questions www.computing.net/answers/linux/a-couple-of-linux-questions/22458.html

find string and copy file script www.computing.net/answers/linux/find-string-and-copy-file-script/29609.html

How to self-test Gnomemeeting www.computing.net/answers/linux/how-to-selftest-gnomemeeting/27846.html