This is something I put together a while back and with the recent discussion on the use-list I figured I would make it available for those that could use it..

This library will parse a CSV file into a multi-dimensional array (I included a simple CSV file).. On large data sets the library might take a while as it does basically crawl through the data character by character in some instances..

Syntax:
  parseCSV( data )
  parseCSV( data, true )

If the second parameter is true, the library will use the first row of the data as names for the column headers (like the data grid).. The data is returned in a multi-dimensional array where the first element is the row number and the second element is the column number (or name)..

  returnedDataArray[1][1]  -- first row, first column
  returnedDataArray[10][3]  -- tenth row, third column
returnedDataArray[3]["file name"] - third row, column named "file name"


This is released into the public domain but if you can help speed it up or know a slightly better way of doing some code in the library, please help out :-)

-Sean
http://shaosean.tk/
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to