Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== RTI_ParseCSV Function ====== ==== Description ==== This function parses CSV files into OpenInsight delimited data. ==== Syntax ==== data = RTI_ParseCSV( inData, skipFlag [, filePath, startRow, endRow] ) ==== Parameters ==== The function has the following parameters: ^Parameter^Description^ |inData|An opened CSV file. If the filePath parameter is provide the inData variable is ignored.| |skipFlag|When parsing the data, the first line may be skipped.\\ \\ \\ \\ __Value__ - __Description__\\ Null - The first line of the CSV file is skipped.\\ 0 (zero) - The first line of the CSV is parsed.\\ 1 (one) - The first line of the CSV file is skipped.| |filePath|(Optional) The full path and name of the CSV file to be imported. if this parameter is provided then the inData parameter is ignored.| |startRow|(Optional) The starting row to be parsed within the CSV file.| |endRow|(Optional) The ending row to be parsed within the CSV file.| ==== Returns ==== The CSV data is returned as @vm delimited data within @fm delimited rows. ==== Remarks ==== A Get_Status() call after the execution of the function will return an error code if the file passed in the filePath parameter encounters an error. ==== See Also ==== [[osread|OSRead]] ==== Examples ==== Example 1 <code> * Parse an open CSV file skipFlag = 1 ; * skip the first line of the CSV data when parsing OsRead inData from csvFile then data = RTI_ParseCSV( inData, skipFlag ) end </code> Example 2 <code> * Parse an open CSV, returning rows 25 through 60 skipFlag = 1 ; * skip the first line of the CSV data when parsing filePath = "" startRow = 25 endRow = 60 OsRead inData from csvFile then data = RTI_ParseCSV( inData, skipFlag, filePath, startRow, endRow ) end </code> Example 3 <code> * Parse a CSV file, passing the filePath to the function skipFlag = 1 filePath = "C:\some_csv_file.csv" startRow = "" endRow = "" Set_Status(0) data = RTI_ParseCSV( inData, skipFlag, filePath, startRow, endRow ) if data = "" then error = Get_Status(errCodes) if errCodes then FsMsg(errCodes) end end </code> Example 4 <code> * Parse a CSV file, passing the filePath to the function. * Parse from row 10 forward skipFlag = 1 filePath = "C:\some_csv_file.csv" startRow = 10 endRow = "" Set_Status(0) data = RTI_ParseCSV( inData, skipFlag, filePath, startRow, endRow ) if data = "" then error = Get_Status(errCodes) if errCodes then FsMsg(errCodes) end end </code> Example 5 <code> * Parse a CSV file, passing the filePath to the function. * Parse through row 10 skipFlag = 1 filePath = "C:\some_csv_file.csv" startRow = "" endRow = 10 Set_Status(0) data = RTI_ParseCSV( inData, skipFlag, filePath, startRow, endRow ) if data = "" then error = Get_Status(errCodes) if errCodes then FsMsg(errCodes) end end </code> guides/programming/programmers_reference_manual/rti_parsecsv.txt Last modified: 2024/06/19 20:20by 127.0.0.1