in reply to Re: Re: CSV file
in thread CSV file

Do you always know how many fields to expect? If not, it may be impossible to properly interrpret the file ie:
"data", "moredate", "this is a field", " and another coma for good mea +sure with unescaped quotes followed by a coma"
was the preceding data 1,2,3, or 4 fields? impossible to tell. Even if you know how many fields there should be it's an impossible problem say there should be 3 fields:
"data blah","foooo","hmmmmmmmm","what if there arnt even numbers of qu +otes"
what are the 3 fields? there are several perfectly legal variants. Impossible.


daN.

Replies are listed 'Best First'.
Re: Re: Re: Re: CSV file
by xorl (Deacon) on Mar 09, 2004 at 17:22 UTC

    The example was one record with 5 fields. The 3rd field is this annoying notes field that has all of the problems.

    The first field is supposed to be the tracking number (actually it's alpha-numeric). The other fields are like first and last name, status of the inquiry, name of the judge.

    With the exception of the notes field (i.e. field3) everything should be limited to no more 50 characters and should just have letters except the id field which is alpha-numeric. Of course the notes field contains the other stuff which I described (and which causes all of the problems).