Page 1 of 1

Number format and quoted strings in CSV export

PostPosted: Fri Aug 28, 2015 7:44 am
by ced45
Hi all,

I am using DBeaver with PostgreSQL under Linux Mint 17.2.
When I perform a resultset export in CSV format, I edit the formatting properties in order to untick "Use Grouping" property for numbers.
The sample removes spaces between numerals, which is what I expect in the final export (1234567890,012 instead of 1 234 567 890,012).
I have also seen a new property "%dataTransfer.processor.csv.property.quoteChar.name" set to ". I try to remove the double quote, in order to remove quotes around strings in the final export.

But unfortunately, both of these configurations do not work in the resulting CSV file : there are still spaces in the exported numbers, and strings remains quoted.

Is it a bug ? Or what am I doing wrong ?

Thanks for your help and thanks a lot for all the job around DBeaver.

Cheers,

Cedric

Re: Number format and quoted strings in CSV export

PostPosted: Fri Aug 28, 2015 8:14 am
by Serge
1. You can configure numbers formatting.
Click on "Edit" button after Formatting combo:
csv_export_config.png
csv_export_config.png (12.83 KiB) Viewed 80544 times

Configure numbers formatting by disabling grouping:
numbers_formatting.png
numbers_formatting.png (18.66 KiB) Viewed 80544 times

Perform CSV export.

2. Property name "%dataTransfer.processor.csv.property.quoteChar.name" is actually a bug in resources, I'll fix it.
3. Currently it is not possible to disable quoting because it breaks CSV format. DBeaver quotes all strings which starts from numbers and all strings which contains CSV delimiters.

Re: Number format and quoted strings in CSV export

PostPosted: Fri Aug 28, 2015 11:28 am
by ced45
Thanks for your answer.

I had configured numbers formatting before my export, as mentionned in my first message.
But to take effect in the CSV file, curiosly, I had to restard DBeaver...

Other strange bug : strings are now surrounded by "n" and no more quotes. This is probably because I change the property "%dataTransfer.processor.csv.property.quoteChar.name"...
Ooops, I think I made a mistake... :oops:

Re: Number format and quoted strings in CSV export

PostPosted: Wed May 04, 2016 7:13 pm
by GNunley

Re: Number format and quoted strings in CSV export

PostPosted: Thu May 05, 2016 9:18 am
by Serge
You can just reset option to default value (in the context menu).
If, for some reason, it doesn't work - provide more details.

Re: Number format and quoted strings in CSV export

PostPosted: Thu May 05, 2016 1:57 pm
by GNunley

Re: Number format and quoted strings in CSV export

PostPosted: Thu May 05, 2016 5:40 pm
by Serge
Well, I was able to reproduce the problem. Although I still don't understand how it may happen in normal circumstances.
Fix will be added in the next version (or you can try to build from sources right now).

Quote character config resides in %HOMEPATH%\.dbeaver\.metadata\.plugins\org.jkiss.dbeaver.core\dialog_settings.xml in section "stream.csv", key "quoteChar".
What value do you have in your local config?

Re: Number format and quoted strings in CSV export

PostPosted: Thu May 05, 2016 5:57 pm
by GNunley

Re: Number format and quoted strings in CSV export

PostPosted: Tue May 10, 2016 1:35 pm
by Serge
Version 3.6.7 includes fix of this issue.

In any case you don't need to build from sources.

You can just fix config. Line
<item value="" key="quoteChar"/>
must look like
<item value="&quot;" key="quoteChar"/>

Empty value is a result of some bug which I can't reproduce.

Re: Number format and quoted strings in CSV export

PostPosted: Tue May 10, 2016 2:04 pm
by GNunley
Thank you very much for your help on this issue!

I downloaded and installed version 3.6.7 from this link "http://dbeaver.jkiss.org/files/dbeaver-ce-latest-x86_64-setup.exe" and this seems to have addressed my issue!

Greg