The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help for Sed Syntax problem SanjayLinux Shell Programming and Scripting 2 10-15-2007 10:52 PM
syntax problem grepping? dsimpg1 Shell Programming and Scripting 9 07-17-2007 05:48 PM
Syntax problem with Unix ftp get command mheinen HP-UX 2 02-09-2007 10:01 AM
syntax problem rajan_ka1 Shell Programming and Scripting 3 03-16-2006 07:13 AM
multiple cuts syntax problem Gerry405 UNIX for Dummies Questions & Answers 12 10-31-2005 06:23 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-08-2006
Registered User
 

Join Date: Sep 2005
Posts: 130
syntax problem

dear friends,

I have a large size file containg two fields data

like this

*** ****
122 222
***** *****
***** *****
232 233


i have file like this.

i want to remove blank lines from file .

i think awk is servive this problem

i wrote a awk command but the error is coming .

mu command is like this

awk ' $1 != /*/*/*/' file.dat > new

but this command syntax has problem

please anyone correct the syntax and let me know.
Reply With Quote
Forum Sponsor
  #2  
Old 03-08-2006
Registered User
 

Join Date: Dec 2005
Location: India
Posts: 218
a workaround solution


Quote:
awk -F '*' '{print $1}' f3.txt|awk NF > new
where f3.txt is input file
tell me if you were looking for somthing else

Gaurav
Reply With Quote
  #3  
Old 03-08-2006
Registered User
 

Join Date: Jan 2006
Posts: 24
sed '/^$/d' $filename

John Arackal
Reply With Quote
  #4  
Old 03-08-2006
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,016
Code:
nawk 'NF' myFile
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




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


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

Content Relevant URLs by vBSEO 3.2.0