I am newbie to groovy. In command prompt (I am not using any IDE), I typed following : (No Problem with environment variables settings please)
groovy -n -e "println line.toLong()" data.txt
Error :
Caught: java.io.IOException: Invalid argument
java.io.IOException: Invalid argument
data.txt is there in that directory (verified using TAB key)
Not sure why its throwing Error ????
[data.txt contains raw data in following format]
1
2
3
4
I tried to duplicate the problem with Groovy 2.3.6 and Java 1.7.0_60 on Linux and had no issue:
With a non-existing file:
With non-numeric data:
And it even worked with CR/LF EOL: