This is an old revision of the document!


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')"/>