CSV Export and Copy and Paste Problems


I'm having two distinct problems when working with results from queries against a MySQL database.

First, some of my CSV exports of my query results are having individual rows split into multiple rows. For example, if I was selecting the columns ID, Person ID, First Name, Last Name and Gender, for the first result when exported into excel, the column ID, person ID and first name might be in row 2, then the last name and gender are in row 3 for some reason. This doesn't always happen, but I can't figure out a rhyme or reason to it.

I also am having trouble copying my results into both excel and a web-based app we use. In excel, it only pastes all results into a single column. I can use the delimiter in Excel to make it work, but that's annoying when MySQL workbench understands what I'm trying to do when I paste from the results into Excel. Also, we have a few queries that we paste the results (a single set of numbers separated by commas) into a web-app. When I paste into our web-app, it pastes with quotes around every number, which doesn't work in the web-app. 

My settings for exporting in CSVs are below. Any help is greatly appreciated.



Could you provide a sample DDL for your tables and some sample data?
Thank you



Update on this: I pinpointed the column of data that was causing the offset and determined it was due to a linebreak in the data (Char(13)) that Datagrip was interpreting differently from MySQL Workbench. I updated my data to remove the line break, and we are good.


Please sign in to leave a comment.