Created
August 13, 2011 19:36
-
-
Save xlson/1144188 to your computer and use it in GitHub Desktop.
Sample of using the autodetect feature of groovycsv 0.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The first sample of using autodetection in groovycsv. More about the project at https://github.com/xlson/groovycsv