943,879 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 4897
  • Perl RSS
Jul 28th, 2008
0

Script to Remove duplicate lines from a text file.

Expand Post »
Script to Remove duplicate lines from a text file.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bgbiplab is offline Offline
2 posts
since Jul 2008
Jul 28th, 2008
0

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

The answer is 49.
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006
Jul 29th, 2008
0

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

Click to Expand / Collapse  Quote originally posted by KevinADC ...
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.
Reputation Points: 16
Solved Threads: 2
Light Poster
Major Major is offline Offline
46 posts
since May 2008
Jul 29th, 2008
0

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

Hey, he doesn't need to use regular expressions. A hash will do fine.
Reputation Points: 18
Solved Threads: 4
Light Poster
chaosprime is offline Offline
46 posts
since Jul 2008
Jul 29th, 2008
0

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

Click to Expand / Collapse  Quote originally posted by chaosprime ...
Hey, he doesn't need to use regular expressions. A hash will do fine.
Didn't think about that
Reputation Points: 16
Solved Threads: 2
Light Poster
Major Major is offline Offline
46 posts
since May 2008
Jul 29th, 2008
0

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

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.
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006
Jul 29th, 2008
0

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

But that would be sensible and prevent unnecessary effort. This is the Internet, mister! We don't hold with that sort of behavior!
Reputation Points: 18
Solved Threads: 4
Light Poster
chaosprime is offline Offline
46 posts
since Jul 2008
Jul 29th, 2008
0

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

Click to Expand / Collapse  Quote originally posted by chaosprime ...
But that would be sensible and prevent unnecessary effort. This is the Internet, mister! We don't hold with that sort of behavior!
LOL.....
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: Can't seem to find the problem...
Next Thread in Perl Forum Timeline: Proper Setup?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC