G
G
god_dan632021-11-23 11:02:51
Python
god_dan63, 2021-11-23 11:02:51

How to use python to find a value in a doc file, determine in which table and column it is?

I have a doc file with 15 tables, in some cell of one of the tables there is a value, I need to determine in which of the tables it is located and its row with a column.
Is it possible?
I can also get this doc file in html format, maybe it will be easier there?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alan Gibizov, 2021-11-23
@phaggi

god_dan63 , with the help of parsers , of course. Depending on what needs to be parsed, choose a parser, study its documentation and make a program. If it doesn't work as expected - bring the code and traceback of the error, then there will be a better chance of getting a useful answer.
In your particular case, you can use bs4 for the html version, or python-docx for word. Both allow you to isolate tables and work with them. The first one is a bit more low level. Depending on your skill as a programmer, it might be easier in the more flexible but "complex" bs4, or the somewhat more limited but "simple" python-docx.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question