My file is having unwanted Control-M characters at the end of the records and because of this file is not getting processed.
Please suggest how can I use ReplaceAll function in Groovy to remove it .
CodePudding user response:
This depends on your shell/OS; try "^M" (in the ReplaceAll function), but this is entered by first pressing the "v" key while holding the "control" key down, then pressing the "return" key.
CodePudding user response:
Something like this should work....
csvFileContent.replaceAll("\r\n", "\n");