Copy to Clipboard include column names


Is it possible to include column names when copying query results to the clipboard?



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



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.



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!


Please sign in to leave a comment.