1

I am attempting to parse through NSDUH data which is publicly available here :

http://datafiles.samhsa.gov/study-series/national-survey-drug-use-and-health-nsduh-nid13517

I have seen Python packages like PDFMiner and tabula-py, but I have not been able to have success when I come across a table that is delimited by white space. Here is an example of a survey response that is difficult to mark as a "table" object :

Tobacco Usage Survey - Example Question

The most promising piece that I have together is leveraging "xpdf command line tools" available here : https://www.xpdfreader.com/download.html

I put the "pdftotext.exe" file in my Python directory and can create near-perfect text copies of the pdf files I am manipulating with this command :

C:\Users\UserName\Python\Python37> pdftotext.exe -layout NameOfPDF.pdf

Unfortunately, this output would still require a dependency on a series of regular expressions. If there is an open-source software or python package which can detect that the image attached should be treated as one contiguous block with data points within it, then that would solve my problem.

Your Answer

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

Browse other questions tagged or ask your own question.