how to pick distinct records.......... | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

how to pick distinct records..........

UNIX for Dummies Questions & Answers


Tags
unix commands

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-04-2007
ss4u ss4u is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 12 February 2009, 4:19 AM EST
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
how to pick distinct records..........

How can i pick distinct records which consists of duplicate data from a ASCII file using UNIX commands
Sponsored Links
    #2  
Old 01-04-2007
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Ex-Moderator
 
Join Date: Nov 2004
Last Activity: 16 December 2013, 12:55 AM EST
Location: Bahrain
Posts: 592
Thanks: 3
Thanked 8 Times in 3 Posts
Try uniq command.
Sponsored Links
    #3  
Old 01-04-2007
maheshwin maheshwin is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 29 February 2008, 2:45 AM EST
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
uniq

first u need to sort the file and use the uniq command to get the correct lines
without any duplicates
sort the file and use the uniq command
    #4  
Old 01-04-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
AFK
 
Join Date: Dec 2004
Last Activity: 28 July 2014, 9:39 AM EDT
Location: UK
Posts: 2,351
Thanks: 0
Thanked 6 Times in 6 Posts
Use 'sort -u' if your file isn't already sorted.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SQL - Distinct plus more STOIE Web Programming 4 01-03-2011 11:53 PM
Grep specific records from a file of records that are separated by an empty line Atrisa UNIX for Dummies Questions & Answers 4 12-14-2010 06:51 AM
How to Pick Random records from a large file ajithshankar@ho Shell Programming and Scripting 1 08-06-2009 04:41 PM
Based on num of records in file1 need to check records in file2 to set some condns mavesum Shell Programming and Scripting 3 11-26-2008 10:48 AM
Count No of Records in File without counting Header and Trailer Records guiguy Shell Programming and Scripting 2 06-07-2007 01:15 PM



All times are GMT -4. The time now is 09:23 PM.