Consulting

Results 1 to 2 of 2

Thread: Replacing/Removing XML file lines

  1. #1
    VBAX Newbie
    Joined
    Jun 2020
    Posts
    1
    Location

    Replacing/Removing XML file lines

    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.

  2. #2
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    107
    Location
    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", "")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •