Scraping words from word document

mmker

Junior Member
Joined
Nov 21, 2021
Messages
100
Reaction score
37
Hello,

I have a word document with a lot of lines from which I have to extract a specific word(that I name) and the word that comes right after it.

Any solutions? I don't think I can do it with basic office word tools, so I'm thinking I might need programming.

Thanks!
 
Hello :)

How many lines have the document ? And yes if the document have like thousand lines it is better to do that with programming. i would suggest python.
 
Hello :)

How many lines have the document ? And yes if the document have like thousand lines it is better to do that with programming. i would suggest python.
A lot. I have 250k words in a 555 pages document. I'm willing to pay someone to write me a script in python, so if you or anyone that sees this knows someone available, HMU :)
Thanks!
 
A lot. I have 250k words in a 555 pages document. I'm willing to pay someone to write me a script in python, so if you or anyone that sees this knows someone available, HMU :)
Thanks!
i can do it for you not write you a script but provide you with final results :) let me know
 
i can do it for you not write you a script but provide you with final results :) let me know
I would like a working script because this is not a one time process. Thank you anyway :)
 
This should be simple enough.

Depending on the work, you can use the native python-docx library to extract text, run a search function, find the target word and the proceeding word.

Another solution would be to use ElementTree - since .docx are just compressed archives (zip files) that contain a bunch of XML files. So extracting the file + running the extraction command on the resultant XML would solve your purpose.

The resultant output can be written to a CSV.
 
This should be simple enough.

Depending on the work, you can use the native python-docx library to extract text, run a search function, find the target word and the proceeding word.

Another solution would be to use ElementTree - since .docx are just compressed archives (zip files) that contain a bunch of XML files. So extracting the file + running the extraction command on the resultant XML would solve your purpose.

The resultant output can be written to a CSV.
thanks for your input. I found a solution :)
 
Back
Top