Sample code for reading a CSV file

Mark Schonewille m.schonewille at
Thu Feb 17 15:08:33 EST 2011


A lot of code has been posted already, which might make mine superfluous, but if you want something simple you might have a look here . This script doesn't work if the items in your CSV file contain linefeeds or returns (but could easily be modified).

Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here

On 17 feb 2011, at 19:16, Paul Dupuis wrote:

> So I am tired of reinventing the proverbial wheel over and over again.
> I have a new project that I want to read a CSV file for. Obviously reading the file is easy. And is it was tab separated instead of comma, parsing out the rows and columns is easy as well. However, with comma seperated data where some columns contain string with commas in then that are encapsulated in quotes, just plowing through the itemDelimiter and lineDelimter doesn't work.
> So before I bother to write code to handle encapsulated CSV data, I thought I'd ask if anyone on the use-list has existing code to handle CSV's that they'd be willing to share.
> -- 
> Paul Dupuis
> Cofounder
> Researchware, Inc.

More information about the Use-livecode mailing list