0

A lawyer friend of mine has thousands of files in PDF and Word format. He would like to extract the name and email addresses from these files, preferably in a CSV or Excel format. The files are not in a consistent structure/layout either.

Can someone suggest paid or free software to handle this task?

1

I would use a python solution.

If the word files are in .docx format then python has a number of libraries such as docxpy and docx that allow extracting the text from word docx files. (In one utility that I use for processing word files I use python to use word to convert any .doc files to a temporary .docx format file).

In computer generated PDF files the text is also available and can be extracted using the python pdfminer library - otherwise you are looking at using OCR which is error prone.

Once you have the text content of the file the python regex or re libraries makes short work of locating email addresses and, given that the name elements probably follow a predictable placement and pattern they can almost certainly also be located.

Output to .csv format is simple with the csv library and there are also libraries for writing to excel format directly.

All of the above are Free, Gratis & Open Source and will run under multiple operating systems - it just needs someone to do a few hours work - while there is a lot of help online there are also books that can help such as Automate the Boring Stuff with Python. I am not the author or in any other way associated with this book!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.