Ask Your Question

Save Calc sheet to csv won't import into database

asked 2017-10-23 23:25:30 +0200

updated 2017-10-23 23:26:03 +0200


I get an Excel spreadsheet, open it in a Calc sheet, and then Save As to a csv file. Then I open it in the BBEdit text editor on my Mac and examine it to make sure it's properly delimited. Next I try to import it into a MySQL database using the LOAD DATA INFILE. This works well if I use Excel to do the Save As to csv file but not LIbre Calc sheet. It does save it as a UTF-8 file.

I'd love to get away from Excel if possible so looking for suggestions. Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-10-23 23:50:34 +0200

Answering own question...

Turns out the Save As and Save As Copy both use the Unix line feed as the row terminator. I had the import set up to look for a Mac carriage return (CR). So the solution is to either change the import setting or change the line ending to a Mac CR in BBEdit which is just clicking a popup.

I did look through the Libre preferences and did not see anyway to change this. That would be nice as I don't think some Mac apps would be so easy or friendly to the Unix LF issue.

edit flag offensive delete link more


@duanemitchell I realize you solved your problem. In the future, you may consider just a copy & paste from Calc to the table in Base - see answer in this post.

Ratslinger gravatar imageRatslinger ( 2017-10-24 01:11:45 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-10-23 23:25:30 +0200

Seen: 93 times

Last updated: Oct 23 '17