Page 1 of 1

Replacing an entire XML file within a .DOCX File

Posted: Sat Oct 27, 2012 5:03 am
by tonygardner
Hello.
I have about 300 or so files that need to have the footer completely changed, including text, fields and formatting. I got one file setup just the way I want it, and now want to populate this change into all the other docs.

If I unzip a .DOCX file, I see that it is comprised of several .XML files. The information in my footer seems to reside in footer1.xml and footer2.xml.

I'm wondering if it's possible to drop those two XML files and overwrite them in all the other docs.

I suppose I could try to do a text search and replace, but this way seems so much cleaner to me.

Any thoughts?

Re: Replacing an entire XML file within a .DOCX File

Posted: Mon Oct 29, 2012 11:31 pm
by DataMystic Support
Hi Tony,

You have to do a search/replace - TP does not do file replacement.

Try using Filters\Restrict\Restrict to filenames matching pattern list, with a perl pattern of

Code: Select all

footer[12].xml$
And inside this, a Remove All filter, followed by an Add Header, with the new text.

Re: Replacing an entire XML file within a .DOCX File

Posted: Tue Oct 30, 2012 8:52 am
by tonygardner
Thanks Simon. Apparantly, my Lite version won't cut the mustard on this one.

Since I'm such a cheapskate :oops: I'll have to find another way to do the job.

One day when I'm rich :mrgreen: I'll upgrade to PRO!

Cheers,
Tony G.

Re: Replacing an entire XML file within a .DOCX File

Posted: Tue Oct 30, 2012 9:02 am
by DataMystic Support
Hi Tony - why not the standard edition? $199

Re: Replacing an entire XML file within a .DOCX File

Posted: Tue Oct 30, 2012 9:44 am
by tonygardner
Simon, you truly have an amazing product here. There is no doubt in my mind that TextPipe is worth every penny. In fact, we recently opted to change our primary mail merge data source to use all new field names. TextPipe Light was able to easily do the job of converting thousands of tags from the old names to the new ones. Very impressive!

Regarding upgrading to TextPipe Standard, it took New Creation Music a year to justify purchasing the Lite version because the task would have taken well over 100 hours to complete. For changing the footers, however, I will be using a product called Keyboard Maestro (Mac) to create a macro to loop through all the documents and change their footers one at a time (estimated total time is four hours for development and execution).

For the record, we will most likely be purchasing the run-time version early next year to distribute along with our new SageCharts solution.

All The Best,
Tony Gardner
New Creation Music

Re: Replacing an entire XML file within a .DOCX File

Posted: Tue Oct 30, 2012 12:37 pm
by DataMystic Support
Thank you very much Tony,
a year to justify purchasing the Lite version because the task would have taken well over 100 hours to complete
A year to justify an expenditure of $29? Mixed priorities I think!

Let me know what your needs are for the Run Time version - we have a lot of developer partners who include TextPipe in their apps.