Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 5th August 2009, 20:31
w01verine w01verine is offline
Junior Member
 
Join Date: Aug 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy duplicate lines without uniq command

Hello,
Could you please tell me how to remove duplicate lines from a file without using uniq command?

12-29-08 10:10 121221 server A
12-29-08 10:12 121221 server A
12-29-08 10:10 121221 server c
12-29-08 10:10 121221 server B
12-29-08 10:10 121221 server c
12-29-08 10:12 121221 server A
12-29-08 10:10 121221 server c
12-29-08 10:10 121221 server B
12-29-08 10:10 121221 server c

This is an example file.

Thanks in advance.
Reply With Quote
Sponsored Links
  #2  
Old 5th August 2009, 21:09
Mosquito Mosquito is offline
Member
 
Join Date: Nov 2006
Posts: 85
Thanks: 5
Thanked 6 Times in 5 Posts
Default

Just curious, why can't you use uniq?

First thing you need to do is sort the file. That will make it much easier for you.
Reply With Quote
  #3  
Old 6th August 2009, 10:42
w01verine w01verine is offline
Junior Member
 
Join Date: Aug 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default Hi Mosquito

Thank you for posting

nothing in particular.. I got an alternate way for this..

sort -u filename

This is working as expected for me..
Reply With Quote
Reply

Bookmarks

Tags
remove duplicate lines, without uniq command

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 09:29
proFTPd passive mode problems bisbell Server Operation 8 6th August 2008 21:12
Proftpd LIST permission Problem HugofromBOSS HOWTO-Related Questions 2 23rd May 2008 13:36
i am having some problem ? cobro Installation/Configuration 20 30th April 2008 16:26
help on /etc/rc0.d/K20dnsctl -> ../init.d/dnsctl zimele General 13 23rd August 2006 16:06


All times are GMT +2. The time now is 22:07.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.