mtm81
02-16-2007, 09:37 AM
hi,
I've been given a csv file to convert into an array.. all comman delimited.
thought it would be easy.
Problem is.. each record isn't seperated by a line break!
What actually happens is the record goes across three line breaks, and then onto the new record!
So my plan was to first remove the actual line breaks...
then re-make a new array for each record then only have one line break before the next record.
I've got the breaks removed.. so I thought I would count how many individual fields there are per record.. count up that .. then add a line break and move the next.
this is where I'm stuck!
I know there are 94 individual fields per record.
(originally it was something like 68 on the first line, then the rest on the second line and a couple of stragglers on the third line, then onto the new record..)
Can anyone help getting this corrected?
I've been given a csv file to convert into an array.. all comman delimited.
thought it would be easy.
Problem is.. each record isn't seperated by a line break!
What actually happens is the record goes across three line breaks, and then onto the new record!
So my plan was to first remove the actual line breaks...
then re-make a new array for each record then only have one line break before the next record.
I've got the breaks removed.. so I thought I would count how many individual fields there are per record.. count up that .. then add a line break and move the next.
this is where I'm stuck!
I know there are 94 individual fields per record.
(originally it was something like 68 on the first line, then the rest on the second line and a couple of stragglers on the third line, then onto the new record..)
Can anyone help getting this corrected?