You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A quick/useful feature I miss from spreadsheets and other db browsers is copying rows of a table into the clipboard along with the header line for that selection.
Please add a 'copy special' or 'copy with headers' menu pick.
I then paste the clipboard contents into various tools like plotting or calculators that use the header info for labeling and assignments.
Useful extra information
This would save the extra steps of clicking export to csv and copying the resulting file to clipboard, when I am browsing and filtering as the name of this app is called :)
@sky5walk and @beRto-, the current nightly builds should have the functionality you wanted. Could you test it and consider closing this issue or commenting further some detail?
@mgrojo - It worked well for me. Thanks for adding this!
I downloaded the nightly Version 3.10.99 (Nov 11 2017) and found that after highlighting content, I could right-click to "Copy with Headers". So this solves the base functionality, which is a big plus!
If I may make a couple of further suggestions:
enable a keyboard shortcut for this, like maybe "CTRL+H" copies with headers. (Although maybe there is already a way to define custom keyboard shortcuts? - sorry, I am not familiar enough.)
or if above suggestion is not preferable, maybe put a checkbox in Preferences so that the user can choose to have Copy with Header the default action on CTRL+C (and use the right click menu in rarer case when they want to copy without headers)?
Thanks for the new feature! :)
Followup question --> Why are all entries returned in double quotes?
"xx"[TAB]"yy"[TAB]"1234"[CR][LF]
Is this to allow a TAB character within the data?
Could you add an option to drop all double quotes and just return contents [TAB] or [Comma] delimited?
@sky5walk that is the current behavior for the regular copy and I've just followed that way. This seems perfect for pasting into spreadsheets or inside the application (although in this case pasting the header makes no sense).
I'm not sure whether the way to go is adding options to the copy. What if the export to CSV had the possibility for choosing the current selection additionally to the list of tables?
Another interesting functionality would be that the copy to clipboard be a table in rich format, so it pastes as a table in other applications, like text processors.
I noticed also that pasting back the data from Librecalc pastes an image in the cells, this is not what I expected.
Thanks, I checked the 171124 nightly and my copies to clipboard in either mode, [Ctrl+C] or [Ctrl+H], return the same. There are double quotes surrounding my numeric data. How to enable the HTML mode? Is that user select or algorithmic?
Maybe I am misunderstanding the HTML mode?
Currently, I have to modify my own apps' parsers when scanning clipboard data to key on the header to specify numeric or text. Because all clipboard columns are now double-quoted, I have to convert values to numeric for each cell, atof(),etc. I'm not sure the algorithm MS Excel uses, but that is bloated and slow for sure. If the double quotes only surround text or just not there, I save this step.
@sky5walk the clipboard can store data in different formats. We are now copying to clipboard in HTML and plain text formats at the same time, so there is no option for HTML mode. Both modes are available and it's the duty of the receiving application to select the desired format. I guess your application is getting the text format, and, as you've already mentioned, parsing that will be more difficult than the plain text version.
But changing the text version in DB4S is risky because it is the format used inside the application for copying and pasting in the DB tables. In any case, your suggestion deserves a new issue. Hopefully, it might get attention form MKleusberg or other more experienced DB4S developer so he can give his insight about that change.
The internal copy/paste inside the application uses the quotes to differentiate NULL values from empty strings and maybe for other objectives. I don't know this code very much, maybe @MKleusberg can give a better explanation.
There is a workaround for getting the data without quotes. It is using Excel as an intermediary, since it understand the quoted data, but copies the data without quotes. Then you can paste in your application. I hope this helps.
"There is a workaround for getting the data without quotes. It is using Excel as an intermediary, since it understand the quoted data, but copies the data without quotes. Then you can paste in your application."
I do not need this workaround since I code my own parser. But, I have to make a special case only for DB Browser for SQLite? Even copying table data from a web page does not add these double quotes around every cell?
Isn't the goal of this ticket to add functionality to copy headers? It seems like changing base functionality of how the copy-paste function works would be out of scope? (I'm not saying it shouldn't be discussed - just that it merits its own ticket if we think there is an issue?)
Activity
justinclift commentedon Jul 20, 2017
Yep, good idea. 😄
beRto- commentedon Sep 21, 2017
I came hear looking for this exact same thing! I would also really appreciate this feature being added!
Copy rows + header to clipboard
mgrojo commentedon Nov 11, 2017
@sky5walk and @beRto-, the current nightly builds should have the functionality you wanted. Could you test it and consider closing this issue or commenting further some detail?
beRto- commentedon Nov 12, 2017
@mgrojo - It worked well for me. Thanks for adding this!
I downloaded the nightly Version 3.10.99 (Nov 11 2017) and found that after highlighting content, I could right-click to "Copy with Headers". So this solves the base functionality, which is a big plus!
If I may make a couple of further suggestions:
New shortcut for Copy with Headers and some self-documented shortcuts
mgrojo commentedon Nov 12, 2017
@beRto- Thanks for the feedback. I've added "Ctrl+H" as shortcut for "Copy with Headers". I'll close now this issue.
sky5walk commentedon Nov 15, 2017
Thanks for the new feature! :)
Followup question --> Why are all entries returned in double quotes?
"xx"[TAB]"yy"[TAB]"1234"[CR][LF]
Is this to allow a TAB character within the data?
Could you add an option to drop all double quotes and just return contents [TAB] or [Comma] delimited?
Thanks
sky5walk commentedon Nov 15, 2017
I'm trying to mimic the CSV export functionality in a quicker action and on smaller selections.
mgrojo commentedon Nov 18, 2017
@sky5walk that is the current behavior for the regular copy and I've just followed that way. This seems perfect for pasting into spreadsheets or inside the application (although in this case pasting the header makes no sense).
I'm not sure whether the way to go is adding options to the copy. What if the export to CSV had the possibility for choosing the current selection additionally to the list of tables?
Another interesting functionality would be that the copy to clipboard be a table in rich format, so it pastes as a table in other applications, like text processors.
I noticed also that pasting back the data from Librecalc pastes an image in the cells, this is not what I expected.
I'll take a look to all of this.
6 remaining items
sky5walk commentedon Nov 23, 2017
Thanks, I checked the 171124 nightly and my copies to clipboard in either mode, [Ctrl+C] or [Ctrl+H], return the same. There are double quotes surrounding my numeric data. How to enable the HTML mode? Is that user select or algorithmic?
sky5walk commentedon Nov 24, 2017
Maybe I am misunderstanding the HTML mode?
Currently, I have to modify my own apps' parsers when scanning clipboard data to key on the header to specify numeric or text. Because all clipboard columns are now double-quoted, I have to convert values to numeric for each cell, atof(),etc. I'm not sure the algorithm MS Excel uses, but that is bloated and slow for sure. If the double quotes only surround text or just not there, I save this step.
mgrojo commentedon Nov 24, 2017
@sky5walk the clipboard can store data in different formats. We are now copying to clipboard in HTML and plain text formats at the same time, so there is no option for HTML mode. Both modes are available and it's the duty of the receiving application to select the desired format. I guess your application is getting the text format, and, as you've already mentioned, parsing that will be more difficult than the plain text version.
mgrojo commentedon Nov 24, 2017
But changing the text version in DB4S is risky because it is the format used inside the application for copying and pasting in the DB tables. In any case, your suggestion deserves a new issue. Hopefully, it might get attention form MKleusberg or other more experienced DB4S developer so he can give his insight about that change.
sky5walk commentedon Nov 25, 2017
Ok, let me summarize this way.
Is it risky to follow the cut/paste behavior of MS Excel?
Why add double quotes around each cell's contents?
mgrojo commentedon Nov 25, 2017
The internal copy/paste inside the application uses the quotes to differentiate NULL values from empty strings and maybe for other objectives. I don't know this code very much, maybe @MKleusberg can give a better explanation.
There is a workaround for getting the data without quotes. It is using Excel as an intermediary, since it understand the quoted data, but copies the data without quotes. Then you can paste in your application. I hope this helps.
Find/Replace dialog for SQL editors and logs
sky5walk commentedon Nov 26, 2017
Yes, [Ctrl+H] is better left for Replace. [Ctrl+Shift+C] is fine.
sky5walk commentedon Nov 26, 2017
mgrojo
I do not need this workaround since I code my own parser. But, I have to make a special case only for DB Browser for SQLite? Even copying table data from a web page does not add these double quotes around every cell?
beRto- commentedon Nov 29, 2017
MKleusberg commentedon Nov 29, 2017
@beRto- is probably right 😄 So here's the new issue: #1244. I'll have a look at the code and update that issue later.
Can we close this one then?
sky5walk commentedon Nov 29, 2017
Yes, this issue can be closed, now that you spawned the double-quoting issue.
Thanks for the feature!