Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: speed up one-line "sort|uniq -c" perl code

by maksl (Pilgrim)
on Apr 14, 2003 at 19:46 UTC ( [id://250395]=note: print w/replies, xml ) Need Help??


in reply to speed up one-line "sort|uniq -c" perl code

you would gain a speed by using lesser processes in your bash one liner,instead of "sort |uniq":
sort -u
try to use nl for the line number:
sort -u | nl -ba
Update: bad answer .. this question was not asked .. thx Aristotle

Replies are listed 'Best First'.
Re^2: speed up one-line "sort|uniq -c" perl code (not the OP's question)
by Aristotle (Chancellor) on Apr 14, 2003 at 20:27 UTC
    Uhm, he's not at all interested in a line number, what he wants is an occurence count per word.

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2025-05-16 16:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.