You could do this (assuming the file is not too large, as it loads it all into memory)
void convertCRLF( File input, File output ) {
output << input.text.replaceAll( '\r\n', '\n' )
}
convertCRLF( new File( '/tmp/test.txt' ), new File( '/tmp/test.fix.txt' ) )
Or maybe you could try AntBuilder with the FixCRLF task
An example of this would be:
new AntBuilder().fixcrlf( srcDir:'/tmp/inputs', eol:'lf' )
Which will convert all files in /tmp/inputs
to use lf
as the line-ending