Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Removing repeated lines from file

by Abigail-II (Bishop)
on Jun 24, 2003 at 13:19 UTC ( [id://268487]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Removing repeated lines from file
in thread Removing repeated lines from file

uniq works on sorted files only. The man page suggests that it does remowe consecutive duplicates, but the first sentence states that it removes repeating lines from sorted files.

Then either your man page lies, or your vendor uses a uniq implementation that's not confirming to the POSIX standard.

From the POSIX 1003.1 standard:

DESCRIPTION
The uniq utility shall read an input file comparing adjacent lines, and write one copy of each input line on the output. The second and succeeding copies of repeated adjacent input lines shall not be written.

Repeated lines in the input shall not be detected if they are not adjacent.

Abigail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found