[fpc-pascal] CSV

micahel schneider micsch at gmail.com
Mon Feb 5 00:38:00 CET 2007


Am Sonntag, 4. Februar 2007 13:37 schrieb Antal:
> > For example: if you want that the csv string 'aaaa;bb bb;cccc' becomes a
> > TStrings with 3 items (aaaa, bb bb and  cccc), is necessary to transform
> > 'aaaa;bb bb;cccc' into 'aaaa;"bb bb";cccc'
> > But to do this in a generic way, without knowing if determined value has
> > space than you have to parse each item of the csv, check if has space
> > and then quote. But in this case is better to add the string directly
> > through add method.
>
> I'm also using CSV handling in my programs, and I do it in the following
> way, since I also have these problems:
> * I use not ";" separator, but TAB (#9) separator, which is somehow the
> same, though it is very common to have texts containing ";" or other
> special characters like " or blank-space, which can be messy in the real
> ";" separated tables.
> * I'm reading the file as 'File of char', which anyway permit a better
> parsing, but it's a real slow solution, it takes a lot to process a file
> of char, byte by byte.
> If useful, I can share the codes with you, but I'm not really satisfied
> with this solution neither.
>
> Are there any other solutions available for this?
> Or how to speed up reading and processing the raw file?
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal


found in the net:
ftp://ftp.cncware.com/pub/fpc/csv.pas



More information about the fpc-pascal mailing list