Our current escaping isn't compatible with MS Excel.
What we want:
For point of comparison, we should do whatever the csv module in Python's standard library does as it mirrors Excel closely from a compatibility point of view.
>>> import csv
>>> data = [['double-quote', 'new line', 'tab', 'windows new line'],['"', '\n', '\t', '\r\n']]
>>> import io
>>> output = io.StringIO()
>>> csv.writer(output, dialect='excel').writerows(data)
>>> print(output.getvalue())
double-quote,new line,tab,windows new line
"""","
", ,"
"
We could also consider avoiding double-quoting strings unless required to avoid bloat.
To reproduce
Insert some data with new lines, windows new lines, tabs, etc.
Query it from /exp (or just via the web console as CSV).
Observe incompatible escaping.
Expected Behavior
Once fixed, the output - saved as a .csv file - should open cleanly in excel, including multi-value strings.
Environment
- **QuestDB version**: 6.2.1
- **OS**: all
- **Browser**: any
Describe the bug
If string/symbol columns tabs or new-line characters these are escaped in a manner that is similar to JSON escaping.
Today:
Our current escaping isn't compatible with MS Excel.
What we want:
For point of comparison, we should do whatever the
csv
module in Python's standard library does as it mirrors Excel closely from a compatibility point of view.We could also consider avoiding double-quoting strings unless required to avoid bloat.
To reproduce
Expected Behavior
Once fixed, the output - saved as a .csv file - should open cleanly in excel, including multi-value strings.
Environment
Additional context
No response