CSVFormat has two parameters to control how the leading and trailing spaces around values are handled, but the actual behavior depends on the value being enclosed in quotes or not.
If the value is not enclosed in quotes, setting leading/trailingSpacesIgnored to true will left or right trim the value. For example with this input (using the default format):
the second value will be equal to 'b'.
But if the value is enclosed into quotes, the value is no longer trimmed:
this will give ' b '.
With quoted values the parser actually ignores the spaces between the delimiter and the quote. Thus with this input:
The value returned is ' b '.
If leading/trailingSpacesIgnored is set to false, we get instead ' " b " ' which is consistent with RFC 4180.
|Field||Original Value||New Value|
|Component/s||Parser [ 12317718 ]|
|Fix Version/s||1.0 [ 12320161 ]|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Resolution||Fixed [ 1 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|
|Transition||Time In Source Status||Execution Times||Last Executer||Last Execution Date|
|14d 5h 18m||1||Sebb||26/Mar/12 20:02|
|871d 1h 3m||1||Benedikt Ritter||14/Aug/14 21:06|