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
concatenate all duplicate line in a file. vaskarbasak Shell Programming and Scripting 30 08-29-2008 02:31 AM
duplicate line in a text file nixguy Shell Programming and Scripting 5 04-28-2008 11:19 PM
Remove duplicate entry in one line kharen11 UNIX for Dummies Questions & Answers 5 07-05-2007 11:56 AM
Identify duplicate words in a line using command srinivasan_85 UNIX for Dummies Questions & Answers 8 04-30-2007 10:29 PM
Remove Duplicate line Student37 UNIX for Dummies Questions & Answers 1 02-22-2005 12:00 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #8  
Old 01-30-2007
Registered User
 

Join Date: Sep 2006
Posts: 25
just out of interest, how would i get it down to just the number? i.e. to just:

3661208

thanks

ocelot
Reply With Quote
Forum Sponsor
  #9  
Old 01-30-2007
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Quote:
Originally Posted by ocelot
just out of interest, how would i get it down to just the number? i.e. to just:

3661208

thanks

ocelot
Code:
diff file1 file2 | sort -u | sed -n "/^[<>]/s/^.*\"\([0-9]*\)\"/\1/p"
Reply With Quote
  #10  
Old 01-30-2007
Registered User
 

Join Date: Sep 2006
Posts: 25
thanks anbu23. but i keep getting this error? :

Unmatched "
Reply With Quote
  #11  
Old 01-30-2007
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Its working for me.
Try this
Code:
sed -n '/^[<>]/s/^.*"\([0-9]*\)"/\1/p' file
Reply With Quote
  #12  
Old 01-30-2007
Registered User
 

Join Date: Sep 2006
Posts: 25
thanks that one works.

Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:03 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