Skip to content

Instantly share code, notes, and snippets.

@mawaldne
Last active August 5, 2021 11:33
Show Gist options
  • Save mawaldne/6272854 to your computer and use it in GitHub Desktop.
Save mawaldne/6272854 to your computer and use it in GitHub Desktop.
Read the first line of a file in groovy
def line
new File("test.txt").withReader { line = it.readLine() }
println line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment