Copy to Clipboard include column names
Completed
Is it possible to include column names when copying query results to the clipboard?
Chris
Please sign in to leave a comment.
It is really easy to do I will explain next and it does not matter that they can't export to Excel since you can paste special on Excel separate columns by 'tab'.
After selecting the data you want, on the data grid, click on the grid right upper side 'Settings icon', click on 'Settings...', under Tools > Database > CSV Formats, check the checkbox that has label like 'First row s header'. Then, click OK.
Go back to your data grid, click with right button then Dump data > To Clipboard.
Then paste special on Excel (separate by Tab). I use Libreoffice Calc which identifies the separation and also let me choose.
sadly. Excel format can not be exported.
You can configure import/export format:
I tried checking the "first row is header" box and the headers still don't appear in the output when I dump data to clipboard or when I dump data to a file (CSV). Any pointers?
Yes. A data view (table) context menu, there Data Extractor / Configure Extractors, there in the dialog "Include column names".
Regards,
Alexander.
I have install DataGrip 2016.3.3 on unbuntu. I cannot see this option in my UI anywhere. I am evaluating if I want to purchase this product or not. This would be a useful feature.
Update, nevermind, found it, first row is header.
That's terrible
Definitely going to be the straw that broke the camel's back.
I realized that I needed to highlight the format I want to configure in the upper list ("Comma-separated (CSV)") in order to format the selected format. Now it works.
Solution: on dropdown menu uncheck the "Skip Computed Columns":
Rerun you query command and now when you Dump Data To Clipboard, you have the column names row <3
Spent way too much time researching this issue... and finally the combination of Danielalmeida's and Arthur's suggestions above worked. Can now set output format to TSV, Dump Data to Clipboard, and paste directly into Excel with headers. Thanks!
Settings-→ Tools -→ CSV Formats -→ TSV -→ check the box “First row is header”. While copying ( CTRL + C ) the result set make sure TSV is set on top right of the result set. This way , when you paste the clipboard in excel , it will automatically come with column names and tab separated into each cell.