---restore content starts---
Nothing to do, just two days ago a friend to find me, asked me batch excal data to be inserted into the database, but their own sentences are too painful to write.
Although I use the excal formula splicing strings, batch conversion into SQL statements, but still not very convenient, today is free, I intend to write a small tool, used to convert excal into SQL INSERT statement.
Language on the use of the previous period just learned Python3, by the way to practice practiced hand. Github:https://github.com/nothingstart/excal-to-sql-python3-.git---------------------------------------------- ---------------------------------------------------------------------------------------first talk about a problem I encountered, I started with the Python3 the XLRD, and then the test is to use the xlsx file and then read the date when it becomes a number. Then found inside the excal, the stored date is not the string used, but the number used. This setting is a bit of a hole, such as you enter 666 and then right-click cell format modified to a date, it automatically becomes the 1901/10/27 description read excal data is not quite right. Then Baidu searched the
Can see, for now. There is no module that can be compatible with. xls and. xlsx files at the same time.
Therefore, when you write, you need to process the. xls and. xlsx files separately. According to what we can easily get read. xls uses XLRD to read. xlsx files using OPENPYXL.
Python3-based excal to SQL tools