For parsing CSV files, don't re-invent the wheel and use Text::CSV instead. That will be able to parse each of your sample rows into four fields, and then getting the comma-separated values out of the 3rd column is as easy as my @vals = split /,/, $row->[2]; (see the module's synopsis for example code).
Update: As BrowserUk pointed out below, using a simple split is only appropriate if that field is never more than a plain comma-separated list, and if there is anything more complex going on in that field (quotes, escape characters, etc.) you'll have to use a more advanced method to parse it. If you wanted to play it safe, you could validate the format of that field before splitting it, e.g. $row->[2] =~ /^\d+(?:,\d+)*$/.
Hope this helps,
-- Hauke D
In reply to Re: splitting csv file and saving data (updated)
by haukex
in thread splitting csv file and saving data
by Ganesh Bharadwaj1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |