csvToText Repository

Alex Tweedly alex at tweedly.net
Mon Jun 13 07:45:52 EDT 2016

"into an array" .... in what  way ?    presumably a numerically indexed 

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

would take a variable (such as the output from csvtotext) containing
John <TAB> smith
betty <TAB> boop


myVar[1][1] = John
myVar[1][2] = smith
myVar[2][1] = betty
myVar[2][2] = boop

then we could simply do
    put csvToText(myCSVFileContent) into myText
    split completely myText by CR and TAB

Of course, that can be done in a simple (untested) script
put 0 into lCount
repeat for each line L in myText
   add 1 to lCount
   put 0 into iCount
   repeat for each item I in L
     add 1 to iCount
     put I into myArray[lCount][iCount]
   end repeat
end repeat

but having it done as part of the split command would be much faster 
(and would just feel right to me :-)

-- Alex.

On 13/06/2016 10:06, Peter TB Brett wrote:
> On 10/06/2016 14:53, Mike Kerner wrote:
>> As far as I know, the latest/greatest code for converting csv to text is
>> now on my git repository:
>> https://github.com/macMikey/csvToText
> This is great!
> Can I make a feature request to parse CSV data into an array?
>                                          Peter

More information about the Use-livecode mailing list