Calc inserts white spaces when exporting to csv

Suppose we have a simple table (pipes “|” are field delimitters):

1|aa|a a|aa|
2|bb|bb|b b|

We save it as “Text CSV” (“Save cell content as shown” is checked) and get this file:

1|aa| a  a |aa
2|bb|bb| b  b 

For every cell with more than 1 space-delimitted word Calc inserts one extra white space between all words, field start.and end.

Is it possible to avoid these spaces?

Some time ago there were no additional spaces, I’ve got them in April 2021 (v. 6. …), but I don`t know which version I had previously.

“Save cell content as shown” should be checked to get numbers formatted (prices as 12.30, not 12.3).

Never seen that and I have to produce a lot of csv/tsv files.

My only idea is you may have a space by accident as quoting character (usually "). Then you could try to remove the quoting character (select the field in Export dialogue and remove contents).

1 Like

You’re right, great thanks! Invisible space was a “String delimiter” in export options dialog.

Rather than removing/deleting the “string delimiter” (bad term IMHO) setting, use an ordinary " double quote character instead, so cells containing the field delimiter or a double quote are properly quoted according to the CSV rules.

2 Likes

I’ve tried to remove it, but on the next export it became double quote. So I’ve changed it to pipe, as it is never met in my data “by design” (and I need cell text to be unchanged).

the | pipe-symbol is the Fielddelimiter but not the Stringdelimiter, you should choose "quotes as Stringdelimiter

No, because I want the text in the fields to be unchanged, no escaping. So “pipe” is OK.

If you know what you’re doing and need that it’s ok. So it’s actually PSV, Pipe Separated Values.