Think about Loose Coupling | |
PerlMonks |
Re^4: multicolumn extractionby Kenosis (Priest) |
on Jun 03, 2012 at 17:15 UTC ( [id://974171]=note: print w/replies, xml ) | Need Help?? |
Your reply makes sense, sauoq. I see that I assumed too much by the OP's field representations as not containing any spaces, so it would be best to split on the known field delimiter. Indeed, it would be disastrous if the first field contained spaces. Good catch and thank you for bringing this to my attention. Update: I was curious to see whether there was any speed difference between spliting all or spliting some columns, so I ran the following which creates and splits a 20 column x 10000 row file:
Results:
In this case, spliting only some shows a significant speed advantage--and with this relatively small file. I ran the script many times, getting as high as 31% for splitSome and as low as 21%--but always showing that splitSome is significantly faster.
In Section
Seekers of Perl Wisdom
|
|