Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2015-01-28 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (222 votes), past polls