Appendix: Converting Uploaded Spreadsheet Values to a CSV List
After using an EXCELUPLOAD element to upload data from a spreadsheet into session memory, you can use the GetSessionCSV function to convert the uploaded data into a list of key-value pairs. If successful, the function will return the list as a CSV-formatted string. If unsuccessful, the function will simply return False.
The GetSessionCSV function's syntax is as follows:
GetSessionCSV( ItemName, KeyValueSeparator, ListSeparator, RowSeparator );
The KeyValueSeparator, ListSeparator and RowSeparator arguments are optional.
ItemName is a string containing the name of the session item that holds the uploaded spreadsheet's data. This name is determined by the uploader's syntax - if no name was specified, the uploader will use an item named DataSourceUpload by default.
KeyValueSeparator is a string containing a single ASCII character. The function will use this character to separate keywords from their values in each pair within the output string. If no argument is given, an equality symbol (=) will be used by default.
ListSeparator is a string containing a single ASCII character. The function will use this character to separate the various key-value pairs within each row of the output string. If no argument is given, a comma will be used by default.
RowSeparator is a string containing a single ASCII character. The function will use this character to separate the various rows of the output string. If no argument is given, a pipe symbol (|) will be used by default.
The following example shows the result of calling GetSessionCSV, using the function's default separators:
FirstName=Bob,FaveColour=Blue|FirstName=Bill,FaveColour=Purple| ...
The sample shown features data from two rows of a spreadsheet, each containing two key-value pairs representing the FirstName and FaveColour of a person.