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
Grep help flood Shell Programming and Scripting 3 06-05-2008 10:14 PM
Grep Aejaz UNIX for Advanced & Expert Users 3 04-30-2008 04:10 AM
grep dineshr85 Shell Programming and Scripting 1 10-10-2007 01:52 AM
how to exclude the GREP command from GREP yamsin789 UNIX for Advanced & Expert Users 2 10-04-2007 11:59 PM
Make grep -c display like grep -n? Jerrad Shell Programming and Scripting 2 08-24-2006 09:20 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-26-2008
Registered User
 

Join Date: May 2008
Posts: 6
grep

I have below words in my file
madrid
london SW
tokyo
london SE
germany
New york
london SW
london NE

is there a way I can extract the above word London without having london SW repeated twice. I will like the new file to appear numbered as below
1)london SW
2)london SE
3)london NE

Although I have used grep bt it keeps returning all the lines that contain london. However I do not now how to go about the numbering in the new file. I do not want to use sed or awk at this time as am just learning to get grip with the basics!!!

Every help with a little bit explanation will be much appreciated.

Thank you all.

Musa
Reply With Quote
Forum Sponsor
  #2  
Old 05-26-2008
Registered User
 

Join Date: Feb 2008
Posts: 10
Hi ,

u can try this one

cat <filename> | grep london | sort -u
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 08:20 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