in reply to Re^2: cut vs split (suggestions)
in thread cut vs split (suggestions)
I don't think it is split (which also used the regex engine), so much as it's the assignment to the (global) array.
Avoiding that gets the time down from 37 seconds to just under 7 on my system.
[ 6:55:11.07] P:\test>perl -lne"BEGIN{$,=','} print+(split',',<>)[0..1 +4] " data\25x500000.csv >junk [ 6:55:17.90] P:\test>
Of course, that's only really useful if you only want to print them stright out again, but I guess it gets closer to being comparable with what cut does.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: cut vs split (suggestions)
by sk (Curate) on Apr 17, 2005 at 07:01 UTC | |
by pijll (Beadle) on Apr 17, 2005 at 07:54 UTC | |
|
Re^4: cut vs split (suggestions)
by tlm (Prior) on Apr 17, 2005 at 07:42 UTC |