Skip to main content


A service to read CSV files as a list of row variables or as a table variable

This service is used to convert CSV files into variables to be used within an OpenDataDSL script.


The standard active variable syntax is followed with the id part being the URL of the CSV file, e.g.

csvdata = ${csv:"https://domain/example.csv", options}


The following options affect the way that the CSV data is processed into the variable:

separatorThe character or regex which is used to separate the columns in the CSV file. The default separator is a commaseparator= +
headerposThe line which contains the header information where the column names are extracted from. The default is 1, if there are no headers, use 0headerpos=0
dataposThe number of lines to skip from the header position to where the data starts. The default is 0datapos=1
outputThe output variable type, if it is set as table then the variable is of type table, anything else it is a list of row variablesoutput=table


The following example extracts a csv file from UCI Machine Learning Repository for balloons

// Grab one of the UCI data sets for Balloons

csvdata = ${csv:"","headerpos=0"}
print csvdata.size
for row in csvdata
print row

// Get the data as a table
csvdata = ${csv:"","headerpos=0", "output=table"}
print csvdata.rows.size
for row in csvdata.rows
print row