|
|
[csv]Description
Instance Variables ->fields - An array containing the column names for the CSV file. Will default to [field_names] on creation if/when possible. ->rows - An array of arrays containing the data for the CSV file. Will default to [rows_array] on creation if/when possible. ->loadpath - String, the path to a CSV file to parse into the type. ->titlerow - Boolean, whether or not the CSV file contains a title row. Pertains to both loading and saving files. Defaults to false. ->savepath - String, where to save the CSV file. ->filename - String, the name to use when saving the file. Defaults to "results.csv." Member Tags/Methods ->parseline - Parses an individual line of a loaded file. Used internally by ->load. ->load - Loads a CSV file from the given path. Optionally accepts a boolean 'titlerow' parameter indicating whether or not the source file contains a title row. ->output - Returns the contents of the object formatted as a CSV file. Used internally by ->save and ->serve. ->save - Saves a CSV file to the given path. ->serve - Serves a CSV file to the browser using [file_serve]. ->addrow - Accepts an array to add to ->rows. Parametersnone Sample Usage
Source CodeClick the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
Related TagsComments
05/20/2008, P Schmitz
This crashes... Hi! If I export 1-10 lines of my records (each record having 30 fields) it works. Anything more and Lasso crashes (I get an internal server error). I think this is a memory problem. How can I increase the available memory to csv/Lasso? Thanks, P. Schmitz (pschmitz A T hostnet.ch)
09/20/2007, Daniela Kalb
Great! Great! thx for this type! A million hugs! |
|||||||||||||||||||
Normalise line endings
Hi, This is great thanks. I made one small tweak to normalise the line ending (it seems to be expecting \r\n_). In the load tag #in->Replace('\n','\r'); #in->Replace('\r','\r\n');