0

I am exporting XML files from a system and need to comment out or delete the second line of code in each file (there are about 200 files).

This can be done manually but I was wondering if a VB script is able to do this. If so do you have any ideas of how?

Example of file:

 <?xml version="1.0" encoding="ISO-8859-1"?> 
 <DOCTYPE POWERMART SYSTEM "powrmart.dtd">

Desired Results:

 <?xml version="1.0" encoding="ISO-8859-1"?> 

OR commented out:

  <?xml version="1.0" encoding="ISO-8859-1"?> 
  <!--DOCTYPE POWERMART SYSTEM "powrmart.dtd"-->

Thanks,

A

JNevill
  • 46,980
  • 4
  • 38
  • 63
devAds
  • 97
  • 12
  • 2
    What does "Second line of code" mean. Can you share a before/after of what you want to do to these XML files? Are you wanting to do something similar to [this](https://stackoverflow.com/questions/38494940/how-to-delete-remove-a-specific-line-of-a-text-file-based-on-the-line-number)? – JNevill Oct 31 '17 at 13:49
  • here is an example of code the doctype line is commented out but when these XML files are exported they are not commented out so either need to be deleted or commented out. They are always the second line of code in each file thanks – devAds Oct 31 '17 at 13:56
  • Thanks! I have updated the question with example and two possible desired outputs. – JNevill Oct 31 '17 at 13:58

0 Answers0