Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.

Find and Replace text in a DOCX/ PDF file

Alteryx Partner

Hi All,

Is it possible to find a particular text from a DOCX / Pdf template file and replace it with some other text (input from a user) and output it in the same format with replaced information?

If the Docx file contains a placeholder "<name>", can we replace it with a name input from the user (John Doe) and output the file in doc/ pdf format with the initial formatting? 

Any help is highly appreciated. 

Thanks in advance.

Highlighted
12 - Quasar
12 - Quasar

You should be building the components of your template with the Reporting toolbar tools.  You'd have individual elements, like a Text box where you can use the field names to achieve that dynamic text.  Arrange the report elements with a layout tool, then a Render tool that outputs a doc or PDF

Highlighted
Alteryx Partner

Hi Jason,  

 

Thanks for the quick response.

 

I wanted to maintain the same formatting as the input file. This way I will have to decompose a 60 pager document individually, right?

Is there any other way to input any docx file and just replace text in it?

 

Thanks,

Bharath

Highlighted
11 - Bolide

Probably not the most efficient way, but what I would do is...

 

Use 7-zip to unzip all docx files

Use Text input tool to read all the XML documents replacing any words you need

Use 7-zip to zip the files back up

 

Also, do not read the XML documents as XML, read it in as CSV, and delimit by line "\0" I don't know what to do with the PDF's.

Labels