perl parsing csv file

peterchan75

Supremacy Member
Joined
Apr 26, 2003
Messages
6,721
Reaction score
529
Hi all,

I am trying to extract data from csv files.
1. Read each csv file in a single read i.e. not line by line. Using
local $/=undef;
2. Split the file with "\n" delimiter into an array
3. Go through each array element and split the csv string into an array

All these work fine until I hit a string with some values follow a bunch of commas(i.e. no value). The array size stop at the last values and remaining commas with no value are ignored. Is this normal ?

Well... to get thing going... I push blanks until I get the right size.
:o Bandage job ! :D:D:D:D:D
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top