Log in

View Full Version : Replacing/Removing XML file lines



ROLO18
06-30-2020, 12:54 PM
Hi all,


I'm pretty new at writing scripts. But I'm having a hard time figuring out how to write a simple Macro in VBA to allow multiple xml files to be edited and saved by either removing or replacing a certain text.



For instance I need to delete, from multiple XML files, <!ENTITY % ISOEntities PUBLIC "ISO 8879-1986//ENTITIES... etc


the other thing is I need to replace "&deg" to "°deg" within the same XML files.


Thank you for any help.

heedaf
07-01-2020, 04:08 PM
You will have to load the file into a string and then use the following and resave the file. There are multiple ways of doing it but this should get you started with one way of doing it.


text = replace(text, "<!ENTITY % ISOEntities PUBLIC "ISO 8879-1986//ENTITIES", "")