Differences

This shows you the differences between two versions of the page.

Link to this comparison view

access_csv_file [2016/09/22 02:35] (current)
Line 1: Line 1:
 +===== Read CSV File =====
 +
 +CSV and text files can be accessed with MScript. Below is an example of MScript to set up dataset for the csv file and MScript to read the data from the dataset:
 +
 +  <!-- declare data set -->
 +  <dataset id="​fileDS"​ autorewind="​true"​ mode="​replace"​ db="​File:​dataSetFile.csv"/>​
 +  ​
 +  <!-- load data from the file -->
 +  <action code="​$loadFromDataSource('​fileDS'​)"/>​
 +  ​
 +  <!-- read the data from data set -->
 +  <log level=""​ message="​$dataSetInfo('​fileDS'​)"/>​
 +  <log msg="​reading data: $getData('​fileDS','​col1'​)"/>​
 +  ​
 +  <!-- advance data set to next row -->
 +  <action code="​$nextDataSetRow('​fileDS'​)"/>​
 +  <log msg="​reading next row: $getData('​fileDS','​col1'​)"/>​
 +
  
Print/export
QR Code
QR Code access_csv_file (generated for current page)