in reply to cut vs split (suggestions)
I'd be very surprised if a pure-Perl script beat a native utility like cut.
If cutting out of the columns of these large files is a bottleneck, your options include:
- As you mentioned, piping the output of cut to your script;
- Running cut as a pipe from within your script:
See perlipc.open my $cutter, "-|", 'cut', '-d,', '-f"1-15"', $mongo or die "Fork failed: $!\n"; go_to_town( $_ ) while <$cutter>; close $cutter; - Write a Perl extension module (XS, Inline::C, Swig) to extract the rows.
I like the second option best.
the lowliest monk
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: cut vs split (suggestions)
by BrowserUk (Patriarch) on Apr 17, 2005 at 04:52 UTC | |
by tlm (Prior) on Apr 17, 2005 at 05:13 UTC |
In Section
Seekers of Perl Wisdom