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
get lines with multiple values at a position deepakgang Shell Programming and Scripting 9 03-27-2008 01:23 AM
unable to filter out blank lines ^$ matches nothing venkatkk UNIX for Advanced & Expert Users 5 02-08-2008 07:27 AM
Extract if pattern matches Raynon Shell Programming and Scripting 20 10-29-2007 01:44 AM
Select matches between line number and end of file? Jerrad Shell Programming and Scripting 4 05-24-2006 04:50 AM
Search file for pattern and grab some lines before pattern frustrated1 Shell Programming and Scripting 2 12-22-2005 12:41 PM

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

Join Date: Oct 2006
Posts: 2
How to select lines in unix matches a pattern at a particular position

I have huge file. I want to copy the lines which have first character as 2 or 7, and also which has fist two characters as 90. I need only these records from file. How I can acheive this. Can somebody help me.....
Reply With Quote
Forum Sponsor
  #2  
Old 10-06-2006
Registered User
 

Join Date: Dec 2005
Location: London
Posts: 222
egrep "^[27]|^90" filename
Reply With Quote
  #3  
Old 10-06-2006
Registered User
 

Join Date: Oct 2006
Posts: 2
thanks. It worked...
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 04:09 AM.


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