Does anyone have experience using opencsv in Java to write a csv file where only some of the elements need to be double quoted? The desired output I am looking to test is to make a file that would read:
1,"two",three
but when I try the following code
writer = new CSVWriter(new FileWriter("yourfile.csv"), ',',CSVWriter.NO_QUOTE_CHARACTER);
String[] entries = {"1","\"two\"","three"};
writer.writeNext(entries);
writer.close();
the following output occurs
1,""two"",three
Thoughts?