Last active
August 5, 2021 11:33
-
-
Save mawaldne/6272854 to your computer and use it in GitHub Desktop.
Read the first line of a file in groovy
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
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