Programmatically headless search and replace

Writing a book, Automating Document Production - Discuss your special needs here
Post Reply
gersonfs
Posts: 3
Joined: Thu Mar 15, 2018 2:02 pm

Programmatically headless search and replace

Post by gersonfs »

Hello!

I need to use find and replace via headless, but I have not found a way to do that.
Currently I uncompressed a .docx file and try to locate and replace it directly in the xml file, but often there are tags being opened and closed in the middle of my search string.

I have a template .docx file, and I need to replace certain strings with others, for example a lease, where I need to put name, address and other information via programming.

How i can do it?
OpenOffice 4 on CentOS 7
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Programmatically headless search and replace

Post by RoryOF »

You could use User defined fields; see this article for some helpful information
https://www.techrepublic.com/blog/linux ... penoffice/

I am not certain that "headless" is the way to go - there might be too many substitute fields for convenient and reliable handling.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
gersonfs
Posts: 3
Joined: Thu Mar 15, 2018 2:02 pm

Re: Programmatically headless search and replace

Post by gersonfs »

Thanks RoryOF

Any bookmark / variable that I could find directly in the file word / document.xml would already work perfectly.
OpenOffice 4 on CentOS 7
gersonfs
Posts: 3
Joined: Thu Mar 15, 2018 2:02 pm

Re: Programmatically headless search and replace

Post by gersonfs »

I'm looking to use mono + openxml SDK on CentOS
OpenOffice 4 on CentOS 7
Post Reply