Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Duplicate fields

by mzedeler (Pilgrim)
on Jul 28, 2009 at 10:47 UTC ( [id://783872]=note: print w/replies, xml ) Need Help??


in reply to Re: Duplicate fields
in thread Duplicate fields

Grin. Put in a single A on a line, and everything starting with that is gone. A good way to make the asker think again, but probably not the right solution.

Replies are listed 'Best First'.
Re^3: Duplicate fields
by Utilitarian (Vicar) on Jul 28, 2009 at 11:03 UTC
    Not so much, it drops repeats until a change, though it sorts the contents of the file and strips the newlines, so it's almost certainly the wrong answer, definitely not scalable, and the $past isn't quoted correctly, but other than that it works perfectly ;)
    ~/$ perl tmp.pl data A different line A line similar to the previous one Apples are tasty this is a line which contains the previous line in it's entirety this is not the same ~/$ cat data A A line similar to the previous one A different line Apples are tasty this is a line this is a line which contains the previous line this is not the same this is a line which contains the previous line in it's entirety

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://783872]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-03-19 08:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found