Number format and quoted strings in CSV export

Note: please leave bug reports and feature requests on GitHub

Number format and quoted strings in CSV export

Postby ced45 » Fri Aug 28, 2015 7:44 am

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
ced45
 
Posts: 4
Joined: Mon Jun 08, 2015 2:47 pm

Re: Number format and quoted strings in CSV export

Postby Serge » Fri Aug 28, 2015 8:14 am

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 40036 times

Configure numbers formatting by disabling grouping:
numbers_formatting.png
numbers_formatting.png (18.66 KiB) Viewed 40036 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.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: Number format and quoted strings in CSV export

Postby ced45 » Fri Aug 28, 2015 11:28 am

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:
ced45
 
Posts: 4
Joined: Mon Jun 08, 2015 2:47 pm

Re: Number format and quoted strings in CSV export

Postby GNunley » Wed May 04, 2016 7:13 pm

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...


I am having this same issue today all of a sudden. WhenI export to CSV some of my output result-set strings are also surrounded by "n" characters ...

How do I fix this or reset my settings to original values so this does not happen?

Greg
GNunley
 
Posts: 4
Joined: Wed May 04, 2016 6:57 pm

Re: Number format and quoted strings in CSV export

Postby Serge » Thu May 05, 2016 9:18 am

You can just reset option to default value (in the context menu).
If, for some reason, it doesn't work - provide more details.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: Number format and quoted strings in CSV export

Postby GNunley » Thu May 05, 2016 1:57 pm

Serge wrote:You can just reset option to default value (in the context menu).
If, for some reason, it doesn't work - provide more details.


First, thank you very much for your reply!

I attempted to use the "Restore Defaults" button option in the export process in the "Settings" dialog step, under the "Edit" button for Formatting, and under that in the Numbers format type. I am still having the issue with my results data having "n" characters inserted. Also, my data is not parsing out uniformly in the columns as it should - some data element values are being split apart. causing some row data to be parsed into more columns than it should.

Everything was working fine up until yesterday mid morning, when I noticed that my exports to CSV suddenly began showing "" around some data values. I had not even looked at any of the export dialog properties until after this happened as everything had always worked fine for the last year or more since I first started using DBeaver.

I tried to upload screenshots, but the limits within this forum made that difficult, so I have shared a pdf doc with screenshots that show all the steps I took this morning to perform my export, including a screenshot of the resulting data in the CSV file when opened in Excel. The link to the shared file is:
https://www.dropbox.com/s/yapp7qmlkdi04 ... V.pdf?dl=0

I would really just like to reset DBeaver to all the original settings across the board. The only thing I really don't want to lose is my database connection settings, but I am pretty sure I documented those when I set up the application in the first place, so if you can tell me how to reset everything (re-install?) that would get me to a happy place!

Many thanks, Greg
GNunley
 
Posts: 4
Joined: Wed May 04, 2016 6:57 pm

Re: Number format and quoted strings in CSV export

Postby Serge » Thu May 05, 2016 5:40 pm

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?
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: Number format and quoted strings in CSV export

Postby GNunley » Thu May 05, 2016 5:57 pm

Serge wrote: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?


Here is that section from the "dialog_settings.xml" file in my installation folder:

<section name="stream.csv">
<item value="" key="quoteChar"/>
<item value="csv" key="extension"/>
<item value="," key="delimiter"/>
<item value="top" key="header"/>
<item value="stream_consumer" key="@node"/>
<item value="header,quoteChar,extension,escape,delimiter," key="@propNames"/>
<item value="quotes" key="escape"/>
</section>

This is most likely beyond my non-developer capabilities, but... how would I attempt to "build from sources" ??

Greg
GNunley
 
Posts: 4
Joined: Wed May 04, 2016 6:57 pm

Re: Number format and quoted strings in CSV export

Postby Serge » Tue May 10, 2016 1:35 pm

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.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: Number format and quoted strings in CSV export

Postby GNunley » Tue May 10, 2016 2:04 pm

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
GNunley
 
Posts: 4
Joined: Wed May 04, 2016 6:57 pm


Return to Support



Who is online

Users browsing this forum: No registered users and 30 guests