Bug #64724 Copy query result content should be tab delimited
Submitted: 21 Mar 2012 18:28 Modified: 24 Jul 2012 0:32
Reporter: Dimitriy A Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S4 (Feature request)
Version:5.2.38 CE OS:Any
Assigned to: CPU Architecture:Any
Tags: content, copy, query result, tab

[21 Mar 2012 18:28] Dimitriy A
Description:
Copying row content from query results should be tab delimited (not comma separated). This is a standard behavior of other SQL editors and allows for simple pasting between other programs such as Excel.

The functionality for getting comma separated values should be in the Export feature. Export feature should support both tab and comma separated exports.

How to repeat:
Run any query.
Copy Row Content.
Paste into Excel.

Suggested fix:
By default copying row content should produce tab delimited output. This way it will be directly compatible with programs such as Excel.
[21 Mar 2012 18:49] Valeriy Kravchuk
Thank you for the problem report.
[21 Mar 2012 21:19] Peter Laursen
Now what if a string you copy contains a TAB-character? A TAB-character is a valid character in a string stored in a database.  In Excel it is 'cell-delimiter'(and as a consequence Excel data cannot contain TABs).  And what about newlines(\r\n or \n)? backspaces (\b)? Binary data? Very long strings (TEXT, varchar(20000))?

The project is hopeless if it is about making the GRID display of a database GUI client compatible with spreadsheet.  Even Access GRID display is not compatible with Excel (you cannot reliably copy from one to another). It may work or may not work (depending on data). 

Peter
(not a MySQL person)
[21 Mar 2012 23:20] Dimitriy A
Sure, the database could contain any type of character and possibly binary data. It is not always possible to copy everything from SQL editor to other programs directly. You have to know the type of data you are dealing with. That's why there is also the export functionality, to allow you to select a best output format for your data.

But the most widely used result copying method is not comma delimited (as it is currently implemented), but tab delimited. And this is what I am requesting, that the current method be slightly changed. You would still have the same issues with comma delimeted text since data could contain commas, double quotes, new lines, etc.
[23 Mar 2012 0:08] Dimitriy A
To my surprise the feature already exists. To use it, it requires different methods of copying (which might be confusing to new users of MySQL Workbench).

To get comma delimited data set:
Select desired rows from query result.
Rick click on on the highlighted rows and click on "Copy Row Content".

To get tab delimited data set:
Select desired rows from query result.
Hit Ctrl+C to copy the data.
[25 Mar 2012 16:25] Alfredo Kojima
This is a feature request.
[24 Jul 2012 0:32] Philip Olson
This has been fixed as of the soon-to-be-released Workbench 5.2.41, and 
here's the changelog entry:

A new "Copy Row (tab separated)" option was
added to the result set context menu within the SQL editor. A
comma separated variant of this option already existed.