Skip to content

Instantly share code, notes, and snippets.

@xlson
Created August 13, 2011 19:36
Show Gist options
  • Save xlson/1144188 to your computer and use it in GitHub Desktop.
Save xlson/1144188 to your computer and use it in GitHub Desktop.
Sample of using the autodetect feature of groovycsv 0.3
@GrabResolver(name='Nexus OSS Repo', root='https://oss.sonatype.org/content/groups/public/', m2Compatible='true')
@Grab('com.xlson.groovycsv:groovycsv:0.3-SNAPSHOT')
import com.xlson.groovycsv.CsvParser
def csv = '''Name:Lastname
Mark:Andersson
Pete:Hansen'''
def data = new CsvParser().parse(csv, autoDetect:true)
for(line in data) {
println "$line.Name $line.Lastname"
@xlson
Copy link
Author

xlson commented Aug 13, 2011

The first sample of using autodetection in groovycsv. More about the project at https://github.com/xlson/groovycsv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment