1

I am using CSVWriter to create a csv file in java. The problem is that the leading zeroes are getting trimmed in the generated csv.

For example: if I am giving 0001 then its writing 1 and all leading zeroes are trimmed.

A solution to this problem was to append a = before the no. So ="0001" is giving me the right answer. But the problem is how to append = using csvwriter. CSVWriter automatically appends " " to the input so giving =0001 as input it generates "=0001" but I want ="0001". A solution to this was to use CSVWriter.NO_QUOTE_CHARACTER in the CSVWriter constructor and it doesn't append "". But now it is generating =0001 and I want ="0001". Any idea how can I keep quotes ("") and append an = before the number??

1 Answers1

0

Upgrade to version 1.8 or later.

Danny F
  • 16