Answer the question
In order to leave comments, you need to log in
How to parse data from excel file?
Hello!
I apologize in advance for not quite clear, as for me, the explanation of my problem.
I am working on a project at the university, the essence of which is parsing data from Excel with subsequent saving in PostgreSQL.
I was given a table, asked to write a program for it. I wrote, the data was successfully parsed. But then they threw me another dozen tables, and this is where the problems started. The tables are somewhat different in the sense that the data that is in the nth row and jth column in the first table (1 screenshot) may be in other tables in other tables (2 screenshot).
Answer the question
In order to leave comments, you need to log in
Theoretically: The similarity of these documents is that they have a cell Protocol number , We start looking for this cell from column A. Let's say cell A1, If the cell is not empty, compare it with the value Protocol number , if they do not match, compare further. A2 = Protocol no . An = Protocol # ?. Not found in column A, see column B.
Found the protocol. Then you make an offset from the protocol and, according to the principle, if the cell is not empty, it should equal the date. Check if the value is a date. here either by standard library tools if there is such an opportunity, or by hand (if there are only numbers in the cell, if there are 3 dots, slashes, etc.)
The excel file to be imported into the database must have a strictly specified format.
When loading, you need (as far as possible) to check for compliance.
If a mismatch is found, throw an error and download nothing.
Attempts to search for the necessary data in files of an inappropriate format often end up with a bunch of garbage in the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question