Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: cut vs split (suggestions)

by dave0 (Friar)
on Apr 17, 2005 at 05:47 UTC ( #448594=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ time perl -lanF, -e 'print join ",", @F[0..14];' numbers.csv > /dev/
    +null
    
    real    0m9.880s
    user    0m9.716s
    sys     0m0.034s
    
  2. or download this
    $ time perl -lanF, -e 'BEGIN{ $,=","} print @F[0..14];' numbers.csv > 
    +/dev/null
    
    real    0m8.974s
    user    0m8.772s
    sys     0m0.042s
    
  3. or download this
    $ time perl -ln -e 'print $1 if /((?:[^,]+,){14}[^,]+)/' numbers.csv >
    + /dev/null
    
    ...
    user    0m3.370s
    sys     0m0.031s
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-07-30 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls