Remove carriage returns using Scanner
From MyWiki
The headers of the Janet csv file
"Request ID", "Common Name", "Renewal Date", "Requested By", "Certificate Type", "CSR SANs", "Extra SANs", "Certificate Expiry Address", Status
File file = new File("yourFilePath.txt"); // create File object to read from Scanner scanner = new Scanner(file); // create scanner to read Printwriter writer = new PrintWriter("someOutputFile.txt"); // create file to write to while(scanner.hasNextLine()){ // while there is a next line String line = scanner.nextLine(); // line = that next line // do something with that line String newLine = ""; // replace a character for (int i = 0; i < line.length(); i++){ if (line.charAt(i) != '*') { // or anything other character you chose newLine += line.charAt(i); } } // print to another file. writer.println(newLine); }