Skip to content

Instantly share code, notes, and snippets.

@xconnecting
Created September 18, 2012 04:54
Show Gist options
  • Save xconnecting/3741333 to your computer and use it in GitHub Desktop.
Save xconnecting/3741333 to your computer and use it in GitHub Desktop.
Groovy: file read and write
def reader = new File('in.txt').newReader('UTF-8')
def writer = new File('out.txt').newWriter('UTF-8')
reader.eachLine{
println it
writer.writeLine(it)
}
writer.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment