Computing.Net > Forums > Unix > Awk script

Awk script

Reply to Message Icon

Original Message
Name: Prasanna
Date: April 5, 2006 at 03:44:57 Pacific
Subject: Awk script
OS: XP
CPU/Ram: Pentium
Model/Manufacturer: Intel
Comment:

I have 4 columns in a record. sometimes the 2nd & 3rd column happens to be a NULL.for those records with 2nd & 3rd column is null the $2 of AWK takes the 4th not null column. I don't want the awk to behave this way. How do I go about in this case.


Report Offensive Message For Removal


Response Number 1
Name: nails
Date: April 5, 2006 at 07:45:05 Pacific
Reply: (edit)

A null column means an undefined column. Therefore, you can't say your record has 4 columns if one of them is null. awk has a field seperator, FS, variable that you might be able to use.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Awk script

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge