iKnowNothing has asked for the wisdom of the Perl Monks concerning the following question:
The @ColumnNumbers array has been defined previously, and would look something like: (1,10,32,69,200,291) UPDATE: The problem turned out not to be related to the code above. Thanks for the input though. Turns out I was running another algorithm every time through the loop that I thought I was only running the first time.while(<INFILE>) { # get the current line and split into it's columns @Line = split /\s+/, $_; #print the selected columns to the output print OUTFILE join("\t",@Line[@ColumnNumbers]),"\n"; }
Retitled by davido from 'Why is this so slow?'.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Optimizing slow restructuring of delimited files
by davido (Cardinal) on Jan 25, 2005 at 18:01 UTC | |
Re: Optimizing slow restructuring of delimited files
by periapt (Hermit) on Jan 25, 2005 at 18:10 UTC | |
Re: Optimizing slow restructuring of delimited files
by BrowserUk (Patriarch) on Jan 25, 2005 at 18:43 UTC | |
Re: Optimizing slow restructuring of delimited files
by Aristotle (Chancellor) on Jan 25, 2005 at 23:22 UTC | |
Re: Optimizing slow restructuring of delimited files
by holli (Abbot) on Jan 25, 2005 at 19:34 UTC | |
Re: Optimizing slow restructuring of delimited files
by NateTut (Deacon) on Jan 25, 2005 at 19:30 UTC |