distal-attribute
distal-attribute
distal-attribute
distal-attribute

Copy/Paste select results

ahri posted 7 months ago in General

I tried searching for the answer, but only things popping up are answers from 6 years ago when things were different.

I can normally select multiple rows/columns in a select result, but Ctrl+C copies only the highlighted cell. Is there an option to make it copy multiple cells (in any format)? I know there is an "export grid cells" feature, but it isn't handy to go through multiple menus/forms/windows for such a simple task.

Thank you.

kalvaro posted 7 months ago

I think it's a good idea, esp. considering that you can already select rows and having Ctrl+C copy only one item is not particularly intuitive.

I've just checked SQL Server Management Studio and Oracle SQL Developer and both copy selected rows as tab-separated values.

ansgar posted 7 months ago

Yes, definitely a good idea. I guess it would be good to use some normal CSV format when just copying without the grid export dialog.

sastrup posted 7 months ago

Commenting here to show interest in that functionality. Going through multiple menus to export a small number of rows is way to tedious.

ahri posted 7 months ago

It might as well work as a shortcut for export grid rows, actually, just preset. For example, you can set up a parameter combination (Excel CSV/Delimited Text/XML ...; delimiter, line terminator...) you like somewhere in options, and then Ctrl+C "exports" in that same format to clipboard. That would make it simpler to implement, too, I assume.

Thanks for considering this! :)

head posted 6 months ago

Seems this thread not same old like rest of similar ones.

Is primary key won't export?! See screens.

2 attachment(s):
  • b
  • e
ansgar posted 6 months ago

You probably need to check the option "Include auto increment column" to get the primary key column.

1 attachment(s):
  • grid-export-primarykey
ansgar posted 6 months ago

To come back to the initial feature request here:

What about adding a new checkbox to the grid-export dialog, labelled "Set default copy mode", which - when the user checks it - sets all options for upcoming copy-to-clipboard clicks on a grid.

head posted 6 months ago

to check the option "Include auto increment column" That's it! And about checkbox - good idea, but it will appear somewhere in global settings, otherwise it may be difficult to remember "where heck it was"?

head posted 6 months ago

Sorry, i'm not familiar with markup here :)

ansgar posted 6 months ago

I meant the checkbox to live on the export dialog, in the free space at the bottom.

1 attachment(s):
  • export-grid-copy-settings
head posted 6 months ago

I got idea. I'm about "Set default copy mode" - if it makes GLOBAL settings change - it will be in preferences - someone may set it and forgot where to uncheck. Optionally (and ideally) - in both places.

ahri posted 5 months ago

ansgar: could you post here when you add this feature, so I know when to update :). Thank you! :D

ansgar posted 5 months ago

See my additions in r5160.

Not sure if that was a good idea though, as I personally and probably others too, would expect HeidiSQL to copy the single focused cell to clipboard. But we will see what you say.

If you find bugs please report them here.

ansgar posted 5 months ago

See the attached screenshot for the new button/feature.

Also notice that only the yellow settings are used as copy-to-clipboard settings. I think the others make not much sense here.

1 attachment(s):
  • grid-export-clipboard-settings
andilist posted 5 months ago

I'm not sure, if this is a good idea.

With older versions "copy" only copied the selected cell. Now the complete row is copied every time. To copy one cell, you have to go to "edit-mode" to copy the cell. That's possible but inconvenient.

But if you have a query with a join you can't go to edit-mode of a cell. So it's not possible to copy one cell of a select result with a join. That's not good.

Maybe there should be two functions: copy cell to clipboard. Copy selected rows to clipboard.

For me, the best solutions looks different: First, it should be possible to select only some columns and not only complete rows.

If one cell is selected. Only this cell should be copied. If multiple columns and/or rows are selected, only the selected columns/rows should be copied (with the preferences from export dialog).

head posted 5 months ago

Alternate idea - make additional shortcut for "Copy all selected". I suggest Ctrl+Shift+C. And use dialog settings for.

head posted 5 months ago

And button in dialog can be used to set default "Copy all" settings.

ansgar posted 5 months ago

Yes, I guess that's a good idea. So, the "Copy" and "Cut" menu items work again as in previous builds, and we have a new menu item for the more complex copy thing.

head posted 5 months ago

Yes!!! :)

ubelni posted 5 months ago

Hi. I did not like the idea. I really miss to copy a field Ideal: Ctrl + c : Copy current field Ctrl + Shift + c : Copy rows.

Thank's Ansgar.

mark88z posted 5 months ago

Hi if i pressed Ctrl + c not copy the sigle field but start export procedure the copy-function work well with Ctrl+shit+c. This is a problem because the combination key don't work

leeoniya posted 5 months ago

I frequently use Ctrl+C to copy cell contents from both query results and the data view, this no longer works. To echo what other have stated, I think the original behavior should be kept and an additional Ctrl+Shift+C can be used for the new copy-rows behavior.

head posted 5 months ago

ubelni wait. What's wrong? My idea (accepted by Ansgar) was EXACTLY same. Ctrl+C usual copy field. Ctrl+Shift+C - copy selected rows.

leeoniya - same. Are you guys reading somewhere else instead of this forum?

head posted 5 months ago

Ansgar, please roll build with default Ctrl+C behavior asap to avoid further screams :)

ansgar posted 5 months ago

Please update to r5163 - under the "Copy" menu item you will now find a "Copy selected rows" item, which does the above discussed stuff. The "Copy" menu item again only copies the single cell contents.

bzoks posted 5 months ago

Ansgar, current solution is OK (and much more convenient than always going to Export), but it would be much more practical if you would actually use "context" - if there is no selection (active is only one cell), copy this value... if there is something selected (more than one row), Ctrl+C would be expected to copy all selected rows and never single value. Only single-row "selection" (which doesn't seem to exist) would need extra clicking in menu (copy selected rows).

head posted 5 months ago

bzoks, simple copy picks one cell anyway, and "there is no selection" not about Heidi, it's more about Excel - in Heidi you always have active cell and selected row. Thus Ctrl+C to pick cell value and Ctrl+Shift+C to pick entire row. I think it's absolutely acceptable. If you need less data in row - make SELECT required fields. If you need more rows- just shift-click them.

head posted 5 months ago

Bad answers can't be edited. bzoks, for example - imagine you have manually selected 72 of 100 displayed rows and then need to copy one single value without deselect.

bzoks posted 5 months ago

I believe it is much more common scenario that I want to select and copy all results... and heidi could know that more rows are selected and would copy them with ordinary Ctrl+C... "picking" few rows is very rare, but also other tools always copy selection, never current value. So your need to copy single value regardless selection is quite unique :) If needed, I would put such unique scenario to menu, not most common ones. So - I'm still suggesting to detect multiple-rows selection and copy them with regular Ctrl+C. Single row "selection" would always copy single value (not row), except with other shortcut/menu.

head posted 5 months ago

That case may require selection appearance review - for now there's no visual difference in selecting single value or row, and it doesn't allow to select few cells instead of entire row. If Ansgar ready to implement Excel-like selection, it can be easily combined with your idea. For now it's not trivial to determine Visually what you have selected - cell or row.

bzoks posted 5 months ago

That's why I'm saying that single-row can't be automatically determined, but for multiple rows it shouldn't be a problem. I'm not talking about column selection, only row selection.

head posted 5 months ago

I got your idea, more than one row = Ctrl+C to copy.

But then you'll read here new screams "I can't select only ONE row and copy with Ctrl+C, WHY?". So it's mainly about Excel-like selection, and it's up to Ansgar.

ansgar posted 5 months ago

I think it's more clear to have two explicit menu items with their own shortcut, regardless of the current row/cell selection. That's also what I learned in the above discussion with the other users here.

head posted 5 months ago

johnworne sorry, what's your problem?

Please login to leave a reply, or register at first.