Python3-based excal to SQL tools

Source: Internet
Author: User

---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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.