Reading a table from a file using inbuilt python libraries

Hello, everyone. I have just joined this forum, so I would appreciate it if you could be kind to me.

I am using an online IDE environment of Python ( Online Python - IDE, Editor, Compiler, Interpreter (online-python.com).

It doesn’t allow me to install any Python packages.

I am trying to write a program to read a docx file containing a table with a table header and Unicode characters.

I can convert it into a PDF, HTML, or any file format outside of the Python environment.

However, I need to be able to read and act on the tabular content using the built-in libraries available in Python. I tried to convert the file into HTML and then use read_html with pandas, but then again, the lxml package was not installed, and hence, I got stuck.

Do you have any ideas as to how to get that done?

Thanks

Can you convert to CSV?

Done. However, I am unsure if the Unicode characters will lose their sanctity. They are showing as ‘?’.

Could I attach the docx and CSV file for you to see? That might help you better understand.

Maybe pasting screenshots is sufficient?

CSV in principle works with Unicode, but it depends on the application / settings you use to convert. But that’s not a Python question and offtopic here. The ontopic answer would be to use Python libraries to convert, like Pandas with lxml, but then you’re back to the original problem.

This also supports unicode:

Great! Thanks, Peter. I have now confirmed that the CSV file has all the unicode characters. Can you please suggest how I can write Python code to read the content and process it from the CSV file?

Try pandas’ read_csv, or Python standard library: csv — CSV File Reading and Writing — Python 3.12.5 documentation

Great thanks, Peter, for the pointer. It worked for me.