Script to Remove duplicate lines from a text file.

Reply

Join Date: Jul 2008
Posts: 2
Reputation: bgbiplab is an unknown quantity at this point 
Solved Threads: 0
bgbiplab bgbiplab is offline Offline
Newbie Poster

Script to Remove duplicate lines from a text file.

 
0
  #1
Jul 28th, 2008
Script to Remove duplicate lines from a text file.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: Script to Remove duplicate lines from a text file.

 
0
  #2
Jul 28th, 2008
The answer is 49.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 46
Reputation: Major Major is an unknown quantity at this point 
Solved Threads: 2
Major Major Major Major is offline Offline
Light Poster

Re: Script to Remove duplicate lines from a text file.

 
0
  #3
Jul 29th, 2008
Originally Posted by KevinADC View Post
The answer is 49.

42. When you know the question you will understand the answer

OK I'm gonna get sued by Douglas Adams' estate now.

I'll even help out,

first you open the file... then you read it... then you use regular expressions to find and remove duplicates, then close the file and open it for writing and write the new text back, then close the file again.


this has been done many many times over... use <insert favourite search engine here> to find a script and modify it.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 46
Reputation: chaosprime is an unknown quantity at this point 
Solved Threads: 4
chaosprime's Avatar
chaosprime chaosprime is offline Offline
Light Poster

Re: Script to Remove duplicate lines from a text file.

 
0
  #4
Jul 29th, 2008
Hey, he doesn't need to use regular expressions. A hash will do fine.
Chaos
Lost Souls: text based RPG
MUDseek: MUD gaming search
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 46
Reputation: Major Major is an unknown quantity at this point 
Solved Threads: 2
Major Major Major Major is offline Offline
Light Poster

Re: Script to Remove duplicate lines from a text file.

 
0
  #5
Jul 29th, 2008
Originally Posted by chaosprime View Post
Hey, he doesn't need to use regular expressions. A hash will do fine.
Didn't think about that
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: Script to Remove duplicate lines from a text file.

 
0
  #6
Jul 29th, 2008
All he has to do is look in the Snippets section of this website, go to the perl section and read the "Script to Remove duplicate lines" snippet.

42.... been a long time since I read the book.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 46
Reputation: chaosprime is an unknown quantity at this point 
Solved Threads: 4
chaosprime's Avatar
chaosprime chaosprime is offline Offline
Light Poster

Re: Script to Remove duplicate lines from a text file.

 
0
  #7
Jul 29th, 2008
But that would be sensible and prevent unnecessary effort. This is the Internet, mister! We don't hold with that sort of behavior!
Chaos
Lost Souls: text based RPG
MUDseek: MUD gaming search
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: Script to Remove duplicate lines from a text file.

 
0
  #8
Jul 29th, 2008
Originally Posted by chaosprime View Post
But that would be sensible and prevent unnecessary effort. This is the Internet, mister! We don't hold with that sort of behavior!
LOL.....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Perl Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC