Batch file to delete lines of text in an XML file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
StefHancock76
Posts: 1
Joined: 18 May 2017 07:28

Batch file to delete lines of text in an XML file

#1 Post by StefHancock76 » 18 May 2017 08:02

I have been racking my brain to figure out how to create something that will remove the following from .xml files.

I want to remove <?Pub Caret -*[0-999]?> and <?Pub Inc?>

Any suggestions out there?

batnoob
Posts: 56
Joined: 19 Apr 2017 12:23

Re: Batch file to delete lines of text in an XML file

#2 Post by batnoob » 18 May 2017 16:03

Code: Select all

@echo off
findstr /V "<?Pub Caret -*[0-999]?>" "myPath\myfile.xml">>myNewFile.xml
findstr /V "<?Pub Inc?>" "myPath\myfile.xml">>myNewFile.xml


BatNoob

Post Reply