Skip to content

Instantly share code, notes, and snippets.

@xlson
Created April 14, 2011 12:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xlson/919356 to your computer and use it in GitHub Desktop.
Save xlson/919356 to your computer and use it in GitHub Desktop.
Example of using GroovyCSV 0.2 to parse csv
@Grab('com.xlson.groovycsv:groovycsv:0.2')
import com.xlson.groovycsv.CsvParse
def csv = '''Name-Lastname
Mark-'Anderson-Nielsen'
Pete-Hansen'''
def data = new CsvParser().parse(csv, separator: '-', quoteChar: "'")
for(line in data) {
println "$line.Name $line.Lastname"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment