Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-25-2002, 10:39 AM   #1
TheFLY
So Fucking Banned
 
Join Date: Jan 2001
Location: http://www.thefly.net/ --- Quit your job and live off steady traffic.
Posts: 11,856
UNIX question -- how to sort and remove duplicates?

I have a huge file that's full of tons of duplicate lines -- I want to remove all the duplicate lines from the file.

I did a "man sort" and I didn't see any option to remove/ignore duplicate lines --

Anyone know how to do it? I'm sure it's easy...
TheFLY is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-25-2002, 10:44 AM   #2
nuclei
old school fart
 
Industry Role:
Join Date: May 2001
Location: Florida
Posts: 1,015
cat filename.txt|sort|uniq > newfilename.txt
__________________
The next generation of SEO
nuclei is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-25-2002, 10:45 AM   #3
TheFLY
So Fucking Banned
 
Join Date: Jan 2001
Location: http://www.thefly.net/ --- Quit your job and live off steady traffic.
Posts: 11,856
Awesome I did "info sort"

I found it...

"
`-u'
`--unique'
Normally, output only the first of a sequence of lines that compare
equal. For the `--check' (`-c') option, check that no pair of
consecutive lines compares equal."
TheFLY is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-25-2002, 10:46 AM   #4
TheFLY
So Fucking Banned
 
Join Date: Jan 2001
Location: http://www.thefly.net/ --- Quit your job and live off steady traffic.
Posts: 11,856
Quote:
Originally posted by nuclei
cat filename.txt|sort|uniq > newfilename.txt
Cool I like that better... I figured there was a way to pipe it instead of using -o filename
TheFLY is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-25-2002, 10:48 AM   #5
DennisS
Confirmed User
 
Join Date: Jan 2002
Location: N.Y.C
Posts: 265
uniq filename newfilename
__________________
DennisS is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-26-2002, 11:28 AM   #6
Big E
Registered User
 
Industry Role:
Join Date: Mar 2002
Location: San Diego, CA
Posts: 935
sort < in.txt | uniq > out.txt
Big E is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-26-2002, 01:09 PM   #7
Dreamman010
Confirmed User
 
Join Date: Jan 2002
Location: Toronto, ON, Canada
Posts: 1,081
Quote:
Originally posted by TheFLY
I have a huge file that's full of tons of duplicate lines -- I want to remove all the duplicate lines from the file.

I did a "man sort" and I didn't see any option to remove/ignore duplicate lines --

Anyone know how to do it? I'm sure it's easy...

Trying to remove all the duplicate emails from a spam list?

J/k dude
__________________
<a href="http://www2.famoushost.com/home.php" target="_blank"><b><FONT COLOR="FFFF00">www.FamousHost.com</font></b></a><br>Free Hosting With No Headers, Real FTP, <u>Get listed on the biggest TGP's with us!</u>
Dreamman010 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-26-2002, 01:17 PM   #8
DrGuile
Confirmed User
 
Join Date: Jan 2002
Posts: 2,025
Quote:
Originally posted by Dreamman010



Trying to remove all the duplicate emails from a spam list?

J/k dude

thats exactly what I was going to say ;p
__________________
LiveBucks / Privatefeeds - Giving you money since 1999
Up to 50% Commission!
25% Webmaster Referal
Powered by Gamma
DrGuile is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-26-2002, 04:13 PM   #9
pr0
rockin tha trailerpark
 
pr0's Avatar
 
Industry Role:
Join Date: May 2001
Location: ~Coastal~
Posts: 23,088
you know there is some great spam list software out there that can handle multiple millions
pr0 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-26-2002, 07:46 PM   #10
TheFLY
So Fucking Banned
 
Join Date: Jan 2001
Location: http://www.thefly.net/ --- Quit your job and live off steady traffic.
Posts: 11,856
If you want to know what I was really doing... I had some code for one of my scripts to periodically remove dead trades -- using a formula -- blah -- anyway the code was buggy and the result was lots of duplicate entries over the course of many months the script still worked fine but the database was getting full of useless records... basically I fixed my code -- but then I needed to repair the database by removing the duplicates...

Anyway thanks for the help... maybe some day I will try some kind of email marketing but so far I've been too lazy to do it...
TheFLY is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.