Menu

#621 SQL > Results > Copy separated by

SQuirreL
closed
nobody
None
medium
2025-06-22
2025-06-06
No

"Copy separated by" do not make a header line. My proposal: Either another rightMouse menu "Copy with headers separated by...", or a new checkbox "With Headers" within "Copy separated by" dialog. --Thank you

Discussion

  • Stepan RYBAR

    Stepan RYBAR - 2025-06-06

    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
  • Gerd Wagner

    Gerd Wagner - 2025-06-09

    The following was implemented and will be available in future snapshots and versions, excerpt from change log:

    '#621 The UI table's "Copy separated by ..." right mouse menu function now allows
    to include column headers and to define a cell delimiter.

     

    Last edit: Gerd Wagner 2025-06-09
  • Stepan RYBAR

    Stepan RYBAR - 2025-06-18

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

     
  • Gerd Wagner

    Gerd Wagner - 2025-06-22
    • status: open --> closed
     
  • Gerd Wagner

    Gerd Wagner - 2025-06-22

    Closed as requested.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.