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
Search for all the unique file extension riverside Shell Programming and Scripting 1 04-09-2008 01:47 PM
Extracting records with unique fields from a fixed width txt file sitney Shell Programming and Scripting 8 02-09-2008 11:18 PM
Urgent: selecting unique specific content of a file using shell script jisha Shell Programming and Scripting 2 01-08-2008 04:45 AM
how to read all the unique words in a text file aditya.ece1985 Shell Programming and Scripting 5 11-29-2007 10:26 PM
Unique cell vaules in a file rahulrathod Shell Programming and Scripting 3 01-17-2006 03:42 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2006
Registered User
 

Join Date: Jan 2006
Posts: 71
sorting file and unique commnad..

hello everyone..

I was wondering is there a effective way to sort file that contains colomns and numeric one.

file

218900012192 8938929 8B8DF3664 1E7E2D59D5 0000 26538 1234 74024415
218900012979 8938929 8B8DF3664 1E7E2D59D5 0000 26538 1234 74024415
218900012992 8938929 8B8DF3664 1E7E2D59D5 0000 26538 1234 74024415
218900012992 8938929 8B8DF3664 1E7E2D59D5 0000 26538 1234 74024415
218900012972 8938929 8B8DF3664 1E7E2D59D5 0000 26538 1234 74024415
218900012992 8938929 8B8DF3664 1E7E2D59D5 0000 26538 1234 74024415
218900010692 8938929 8B8DF3664 1E7E2D59D5 0000 26538 1234 74024415
...
...
..
.
to sort and remove in this case lines 4 and 6 (becouse they R dupicated in file)using unique command I was trying to to something with that command but it does not work.


thanks a lot
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-15-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,639
Code:
sort -u file.name
Reply With Quote
  #3 (permalink)  
Old 02-16-2006
Registered User
 

Join Date: Feb 2006
Location: Southern England
Posts: 102
rtfm

uniq only works on sorted files.
as vino says sort -u will do it
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:39 AM.


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

Content Relevant URLs by vBSEO 3.2.0