The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Column sum group by uniq records Nayanajith Shell Programming and Scripting 3 01-28-2008 05:45 AM
Select Record based on First Column mgirinath Shell Programming and Scripting 8 07-15-2007 10:38 PM
column based search user_007 Shell Programming and Scripting 8 07-01-2007 02:52 AM
awk to select a column from particular line number mab_arif16 Shell Programming and Scripting 4 05-08-2006 02:26 AM
Selecting records from file on criteria. videsh77 Shell Programming and Scripting 7 12-29-2004 10:20 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2005
Registered User
 

Join Date: Jun 2005
Posts: 40
Select records based on search criteria on first column

Hi All,

I need to select only those records having a non zero record in the first column of a comma delimited file.

Suppose my input file is having data like:

"0","01/08/2005 07:11:15",1,1,"Created",,"01/08/2005"
"0","01/08/2005 07:12:40",1,1,"Created",,"01/08/2005"
"552130000","01/08/2005 07:16:53",2,3,"FIDS_Accept",,"01/08/2005"

Then I need the output having only

"552130000","01/08/2005 07:16:53",2,3,"FIDS_Accept",,"01/08/2005"

Thanks
Shash
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-02-2005
Registered User
 

Join Date: Jun 2005
Posts: 40
Got it...

awk '$1 !~ /"0"/' inputfile > outputfile
Reply With Quote
  #3 (permalink)  
Old 12-02-2005
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 969
sed '/^"0"/d' yourfile.in > yourfile.result

bakunin
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0