![]() |
|
No such thing as a small change | |
PerlMonks |
Re: Pre-process csv files before usingby sk (Curate) |
on Aug 06, 2005 at 18:19 UTC ( #481529=note: print w/replies, xml ) | Need Help?? |
Will you know which columns numbers you want to keep? If so, you can just return the required portion of the array and use it for average calculation.
In the above code i have an array called array then i have a required columns array called req. @array[@req] returns a list with values from the required columns. Regarding the removal of "." from the header, at what point do you want to do it? Before you start reading the CSV into DBI or when you write out? Before you use it in DBI would require you to do an inplace edit. Writing out the correct header (without period) should be very easy. A simple regex on the your "variable column" array.
-SK
In Section
Seekers of Perl Wisdom
|
|