Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.
Register for the upcoming Live Community Q&A Session - and don't forget to submit your questions for @DeanS regarding the future role of analytics here.

How to use R and Python to Parse Word Documents


@mceleavey unfortunately that example probably won't lend itself well for that scenario.


Python or other R packages may get you closer  - 


might be worth starting a new thread and seeing if anyone has anything that could solve it.

Alteryx Certified Partner

Cheers, Shaan. Thanks for all your help.




Hi everybody!


Looks like (Python-DocX) might be what you need Chris, if you're going down the Python route? 




Nick Jewell | Alteryx Product Strategy
Alteryx Certified Partner



Dr. Nick, you magnificent human being!

I will give that a try now.

Alteryx Certified Partner

Unfortunately, that doesn't appear to do what I need. I need to read in .doc files including the values selected in a drop-down. I've found a python package called Textract which claims to do this, but I can't get it working. I'm not at all competent with Python, so it's definitely user error. I've installed the package, and defined the filepaths so I can use it, but it returns a File Not Found error.


I'll keep plugging away...

8 - Asteroid

Hi ShaanM,


OK thank you. I have sent Support an e-mail. I will respond to this thread if a solution is found.

8 - Asteroid

Hi Everyone,


I spoke with Support and I do have a solution that has worked for me for reading Word docs in the Python tool.


1) to install external packages you have to do it in the Admin version of Alteryx. Right click on the Alteryx icon and select 'Run as administrator'



2) drag the python tool onto the canvas and click on it. Type the following into a cell: 


from ayx import Alteryx


Keep the cell selected and hit the 'Run' button within the Python tool itself (not the Alteryx Run Workflow button)



This should install the package onto your computer. You should now be able to use it in the non-admin version of Alteryx. You should not have to do this admin step again for this package (but you will if you want to install others)


3) Open up the non-admin version of Alteryx and drag a Python tool onto the workflow


4) Now the package is installed you need to import its features into your Python kernel. Type the following into a cell:


from ayx import Alteryx
import pandas
import docx2txt


You need to import pandas too since the Word document conversion is to a pandas df.


5) Make sure that the Python tool is sourcing from the correct file directory where your Word document is saved; use the 'cd' (change directory) command to do this:


cd C:\Your\File\Path\Here\


6) Use the following statement to read in your Word Document:






Hope this works for everyone! I've attached my test Word docx file if anyone wants to use it.


I have not got the PDF read-in to work yet but I will update if I do.