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! Quote 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? Quote Link to comment Share on other sites More sharing options...
Solution gizmola Posted April 23, 2018 Solution 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. Quote 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.