Skip to content

Instantly share code, notes, and snippets.

@miceno
Created December 30, 2010 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miceno/759622 to your computer and use it in GitHub Desktop.
Save miceno/759622 to your computer and use it in GitHub Desktop.
Read formatted file one-liner
new File("simple.tab").withReader{r->
line = r.readLine();
println "first line: $line"
r.splitEachLine("\t"){fields->
println "fields on line: $fields"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment