Skip to content

Instantly share code, notes, and snippets.

@mwacc
Created July 9, 2013 09:10
Show Gist options
  • Save mwacc/5955882 to your computer and use it in GitHub Desktop.
Save mwacc/5955882 to your computer and use it in GitHub Desktop.
read/write file
int i = 0;
File file = new File("out2.csv")
file << "Id,Action\n"
new File('out.csv').eachLine { line ->
if(i > 0) {
file.append i
file.append ','
file.append Double.valueOf(line) > 0.6 ? 1 : 0;
file.append '\n'
}
i++
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment