Skip to content

Copy rows + header to ClipBoard #1058

Closed

Description

@sky5walk

Details for the issue

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 :)

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows: ( _version:_10 Pro x64 ___ )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using DB4S version:

  • 3.9.1
  • 3.9.0
  • Other: latest nightly build, 3.9.99

I have also:

Activity

  1. justinclift commented on Jul 20, 2017

    @justinclift
    Member

    Yep, good idea. 😄

  2. beRto- commented on Sep 21, 2017

    @beRto-

    I came hear looking for this exact same thing! I would also really appreciate this feature being added!

  3. added a commit that references this issue on Nov 4, 2017
  4. mgrojo commented on Nov 11, 2017

    @mgrojo
    Member

    @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?

  5. beRto- commented on Nov 12, 2017

    @beRto-

    @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:

    1. 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.)
    2. 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)?
  6. mgrojo commented on Nov 12, 2017

    @mgrojo
    Member

    @beRto- Thanks for the feedback. I've added "Ctrl+H" as shortcut for "Copy with Headers". I'll close now this issue.

  7. sky5walk commented on Nov 15, 2017

    @sky5walk
    Author

    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

  8. sky5walk commented on Nov 15, 2017

    @sky5walk
    Author

    I'm trying to mimic the CSV export functionality in a quicker action and on smaller selections.

  9. mgrojo commented on Nov 18, 2017

    @mgrojo
    Member

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

  10. 6 remaining items

  11. sky5walk commented on Nov 23, 2017

    @sky5walk
    Author

    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?

  12. sky5walk commented on Nov 24, 2017

    @sky5walk
    Author

    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.

  13. mgrojo commented on Nov 24, 2017

    @mgrojo
    Member

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

  14. mgrojo commented on Nov 24, 2017

    @mgrojo
    Member

    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.

  15. sky5walk commented on Nov 25, 2017

    @sky5walk
    Author

    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?

  16. mgrojo commented on Nov 25, 2017

    @mgrojo
    Member

    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.

  17. sky5walk commented on Nov 26, 2017

    @sky5walk
    Author

    Yes, [Ctrl+H] is better left for Replace. [Ctrl+Shift+C] is fine.

  18. sky5walk commented on Nov 26, 2017

    @sky5walk
    Author

    mgrojo

    "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?

  19. beRto- commented on Nov 29, 2017

    @beRto-
  20. MKleusberg commented on Nov 29, 2017

    @MKleusberg
    Member

    @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?

  21. sky5walk commented on Nov 29, 2017

    @sky5walk
    Author

    Yes, this issue can be closed, now that you spawned the double-quoting issue.
    Thanks for the feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions