Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Removing repeated lines from file

by diotalevi (Canon)
on Jun 24, 2003 at 11:45 UTC ( [id://268460]=note: print w/replies, xml ) Need Help??


in reply to Removing repeated lines from file

This is a one-liner. If you add in the '-ibck' flag then you can modify the file directly.

perl -ne 'next if $prev eq $_; print; $prev = $_'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2024-04-25 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found