The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-16-2006
amon amon is offline
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
  #2 (permalink)  
Old 02-16-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Code:
sort -u file.name
  #3 (permalink)  
Old 02-16-2006
bigearsbilly bigearsbilly is offline
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0