mdm37 Posted April 22, 2018 Share Posted April 22, 2018 Hi, Can I import an .xlsx file (Excel) to a MySQL Database by using phpMyAdmin? I am willing to buy this database of all US restaurants which comes in a standard Excel format (with about 10 columns). can I import the file as it is, or should I ask for a different file format such as CSV? thanks! Link to comment Share on other sites More sharing options...
ginerjm Posted April 22, 2018 Share Posted April 22, 2018 I would use the csv. Plus you have to look at the layout closely to be sure that it works in a database format instead of a spreadsheet one. Is the data normalized as it is now? Link to comment Share on other sites More sharing options...
gizmola Posted April 23, 2018 Share Posted April 23, 2018 You can certainly convert it from Excel to csv easily enough, but you need csv to import, so if you can have that instead it saves you some complications. The important thing with csv is that your string columns need to be surrounded by double quotes so that commas inside a string don't confuse the parsing. This also necessitates that if you have double quotes in the string, the double quotes have to be doubled in order to escape them. Excel export to csv should do this for you, so ultimately it's up to you if the excel has value outside of the import, or if getting a .csv version is more trouble than it's worth. Link to comment Share on other sites More sharing options...
mdm37 Posted April 23, 2018 Author Share Posted April 23, 2018 I would use the csv. Plus you have to look at the layout closely to be sure that it works in a database format instead of a spreadsheet one. Is the data normalized as it is now? You can certainly convert it from Excel to csv easily enough, but you need csv to import, so if you can have that instead it saves you some complications. The important thing with csv is that your string columns need to be surrounded by double quotes so that commas inside a string don't confuse the parsing. This also necessitates that if you have double quotes in the string, the double quotes have to be doubled in order to escape them. Excel export to csv should do this for you, so ultimately it's up to you if the excel has value outside of the import, or if getting a .csv version is more trouble than it's worth. Great, thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.