SQL > Results > Copy separated by
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
Hello,
and once (if) You will change this part of code, I would like to have not only header as Oliver wants, but also add custom user delimiter field (usually double quote) and custom user escape character of delimiter character (usually double quote too) - the same logic as in Export to CSV. Currently I am using Export to CSV to bypass these two missing delimiters, which is quite fine for me, but could be better once implementing most of CSV specification (for example as H2 database does, see https://www.h2database.com/html/grammar.html#csv_options )
Current tricky output and desired output one can see below.
Thank You, Stepan
select 'a b', 1, 2, 'c; d'
union all
select 'e f', 3, 4, 'g; h'
--no doublequotes produces wrong column count, because Cell delimiter is a part of string inside the last column:
a b;1;2;c; d
e f;3;4;g; h
--current tricky delimiter using doublequotes in Cell separator as ";" and Row separator as "\n" (see missing doublequotes at the very start and end of the whole clipboard content):
a b";"1";"2";"c; d"
"e f";"3";"4";"g; h
--desired output with user defined delimiter using doublequotes in Cell separator as ; and Row separator as \n nad new Cell delimiter as ":
"a b";"1";"2";"c; d"
"e f";"3";"4";"g; h"
Last edit: Stepan RYBAR 2025-06-06
The following was implemented and will be available in future snapshots and versions, excerpt from change log:
Last edit: Gerd Wagner 2025-06-09
Hello,
I tested Oliver's and my RFE of this Ticket with SQuirreL SQL 20250609_2217-standard using Adoptium OpenJDK 17.0.14+7 on MS Windows and from my point of view both work very well. I am satisfied.
I think, this Ticked can be closed as Implemented. But I am not Creator nor Owner of this ticket, so I can not close it.
Thank You, Stepan
*P. S.: Strictly saying CSV differs between numeric and other datatypes. Numeric ones should not use Cell delimiter, even it is defined, but then it could be a problem with decimal and thousand delimiter of decimal numbers, which can interference with Cell and Row separator. But for my usage it never mind, because I always can cast numeric in string format, but I can not handle mismatch of decimal, thousand, cell and row separator. To implement whole CSV specification would be too complicated and with minimal profit. *
Closed as requested.