What I need to do is write the lines to a CSV file, the problem in some line contains ,which will split the line in half. Therefore, I am trying to send the string "fileInfo" below to CSV, but, as I said, it sometimes contains ,. Does anyone know how to solve this since I would be very kind!
public class FileOutput {
public void FileOutputToFile(String hex) throws Exception{
String fileInfo = hex;
try {
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("myfile.csv", true)));
out.print(fileInfo);
out.close();
}catch (IOException e){
}
}
}
James source
share