how to grep for blank records (space,tab,/n)? | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Unix/Linux Go Back    


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 !!

how to grep for blank records (space,tab,/n)?

UNIX for Dummies Questions & Answers


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 08-14-2006
Browser_ice Browser_ice is offline
Registered User
 
Join Date: Nov 2005
Last Activity: 6 April 2010, 6:04 PM EDT
Location: Canada
Posts: 118
Thanks: 0
Thanked 0 Times in 0 Posts
how to grep for blank records (space,tab,/n)?

I want to exclude (-v) blank records from a file before analysing it.

I know I can use '^[[:blank:]]$' for spaces and tabs but how do you look for lines that have nothing (/n or line feed) ?
Sponsored Links
    #2  
Old Unix and Linux 08-14-2006
System Shock's Unix or Linux Image
System Shock System Shock is offline Forum Advisor  
Registered User
 
Join Date: May 2006
Last Activity: 4 May 2012, 3:37 PM EDT
Location: Tau Ceti V
Posts: 558
Thanks: 0
Thanked 7 Times in 6 Posts

Code:
grep -v '^$' file.txt


Last edited by System Shock; 08-14-2006 at 10:43 PM..
Sponsored Links
    #3  
Old Unix and Linux 08-14-2006
Browser_ice Browser_ice is offline
Registered User
 
Join Date: Nov 2005
Last Activity: 6 April 2010, 6:04 PM EDT
Location: Canada
Posts: 118
Thanks: 0
Thanked 0 Times in 0 Posts
No why didn't I think of that ?

Silly me.

Thx.l
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
blank space Reham.Donia UNIX for Dummies Questions & Answers 4 10-04-2011 06:18 AM
Cut last blank space Aswex Shell Programming and Scripting 7 03-03-2011 06:36 PM
Grep specific records from a file of records that are separated by an empty line Atrisa UNIX for Dummies Questions & Answers 4 12-14-2010 05:51 AM
Matching exact string with blank space using grep jazzaddict UNIX for Dummies Questions & Answers 4 10-23-2010 08:34 PM
awk delete blank records xiamin UNIX for Dummies Questions & Answers 1 10-31-2001 04:33 PM



All times are GMT -4. The time now is 03:22 AM.