Skip to content

Toro Cloud Dev Center


CsvFunctions

The Csv class contains functions for reading CSV files.

Not for Gloop

The CsvFunctions class is intended for use in Groovy. Gloop already has flat file services, allowing users to read and write flat files (which includes CSV files) natively in Gloop.

Here's a short Groovy snippet using one of the functions in the CsvFunctions class:

1
2
3
4
5
6
File movies = new File( '/path/to/movies.csv' )
movies.eachRecord () { // For every record
    for ( def i = 0; i < it.size(); i++ )
        print it[itr] + ' ' // Print each column
    println '' // Print a new line in between records
}