How do I go around creating a MySQL table schema while inspecting an Excel (or CSV) file? Is there any ready Python library for work?
The column header will be cleared with the names of the columns. DataType spreadsheet will be estimated based on the content of the column. When done, the data will be loaded into the table.
I have an Excel file with ~ 200 columns, which I want to start normalizing.
use the xlrd module; . [Disclaimer: I am the author] classifies cells in the text, number, date, boolean, error, empty and empty; xlrd It separates the dates of the numbers by inspecting the corresponding format of the cell (like "DD / MM / YYY" versus "0.00").
The programming task is to use some code to run through the data entered by the user, which DB datatype is to use for each column, it is not that which can easily be automated with your eyes You can assign types like eyes and integer, money, text, date, date time, time, etc., and you can write code to check your estimation. Note that you should be able to cope with things like numerical or date data entered in the text areas (it may look good in GUI) You need a strategy to handle those cells that do not conform to the "approximate" datatype Are there. You need to validate and clean your data, make sure that you consider text strings as normal (the strip face / back whitespace, replacing many white space from one location. Excel text (BMP-only) Unicode, it Do not share in ASCII or "ANSI" - work in Unicode and encode it to keep it in your database UTF-8.
Comments
Post a Comment