csvToText Repository
Peter TB Brett
peter.brett at livecode.com
Tue Jun 14 09:33:57 EDT 2016
On 13/06/2016 12:45, Alex Tweedly wrote:
> "into an array" .... in what way ? presumably a numerically indexed
> array.
>
> Perhaps a more general feature requests would be to extend the 'split'
> command, so that it would parse by Primary and Secondary delimiters into
> numerically indexed arrays ? (using a new optional keyword "completely"
> ... :-)
>
> e.g. split completely myVar by CR and TAB
Hi Alex,
I don't think an enhancement to the split command would be adequate for
correct parsing of a CSV file.
For example, this is a single line of a valid CSV file, according to
some producers:
> a,"b,c",d e
The elements of the line are: "a", "b,c", "d" and "e". Obviously, this
is best handled by parsing into an array.
Coping with the many subtle variants of CSV or TSV files is beyond what
can be realistically built into the engine, and having a library
specifically dedicated to good CSV file format support seems to me to be
the best way to deal with this.
Peter
--
Dr Peter Brett <peter.brett at livecode.com>
LiveCode Technical Project Manager
LiveCode 2016 Conference: https://livecode.com/edinburgh-2016/
More information about the use-livecode
mailing list