Stringlist.Commatext definitely handles spaces as you describe, and always has. So you can't rely on it if your data is coming in in that format. An alternate process might be to associate a TClientDataset with your CSV file; though I haven't done it, I believe this will provide seamless DB-style access ok.
(Personally, if I were generating a CSV file, I'd always quote any text field, as it *might* contain a comma. But I don't know of any black-and-white standard mandating that). > Hi all > > I have been working with the CommaText method of a stringlist to import a csv file. > One of my test files does not use double quotes around fields containing spaces, the > CommaText method splits the field into multiple fields. > > I thought double quotes were only required around fields containing commas. Does > anyone know which format is the 'Official' format. If the CommaText method does not > function correctly I will right my own (unless anyone has other suggestions). > > > Rob Martin > Software Engineer > > phone 03 377 0495 > fax 03 377 0496 > web www.chreos.com cheers, peter =========================================== Peter Hyde, Development Director, SPIS Ltd, Christchurch, New Zealand * TCompress/TCompLHA component sets for Delphi/Kylix/C++ * TurboNote+: http://TurboNote.com -- top-rated onscreen sticky notes Find all the above and MORE at http://spis.co.nz _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
