How do I....

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
tea
Posts: 8
Joined: 14 Oct 2019 11:58

How do I....

#1 Post by tea » 24 Dec 2019 11:37

Hi guys

I need to edit a .xml file to remove all instances of the word East. How would I do that?

Thank you

Merry Christmas
Happy holidays!
Here is a snipit of part of the file.

guide.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<tv date="22/12/2019 9:28:18 PM" source-info-url="http://schedulesdirect.org" source-info-name="Schedules Direct" generator-info-name="EPG123" generator-info-url="http://epg123.garyan2.net">
  <channel id="00411">
    <display-name>Information</display-name>
  </channel>
  <channel id="10021">
    <display-name>AMC East</display-name>
    <icon height="270" src="https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s10021_h3_aa.png" width="360" />
  </channel>
  <channel id="10057">
    <display-name>Bravo East</display-name>
    <icon height="270" width="360" src="https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s10057_h3_aa.png" />
  </channel>
  <channel id="10093">
    <display-name>FREEFORM</display-name>
    <icon width="360" src="https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s10093_h3_aa.png" height="270" />
  </channel>
  <channel id="10120">
    <display-name>Cinemax East</display-name>
    <icon src="https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s10120_h3_aa.png" width="360" height="270" />
  </channel>
  <channel id="10121">
    <display-name>MoreMax</display-name>
    <icon src="https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s10121_h3_aa.png" width="360" height="270" />
  </channel>
  <channel id="10139">
    <display-name>CNBC US</display-name>
    <icon src="https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s10139_h3_aa.png" width="360" height="270" />
  </channel>
  <channel id="101419">
    <display-name>Real Extreme</display-name>
    <icon width="360" src="https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s101419_h3_aa.png" height="270" />
  </channel>
  <channel id="10149">
    <display-name>Comedy Central East</display-name>
    <icon height="270" width="360" src="https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s10149_h3_aa.png" />
  </channel>
  <channel id="10153">
    <display-name>Tru TV East</display-name>
    <icon width="360" src="https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s10153_h3_aa.png" height="270" />
Last edited by aGerman on 24 Dec 2019 12:53, edited 1 time in total.
Reason: code formatting

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How do I....

#2 Post by aGerman » 24 Dec 2019 12:56

JREPL maybe?
viewtopic.php?f=3&t=6044

Code: Select all

cmd /c jrepl.bat " East\b" "" /f "guide.xml|utf-8" /o -
Note that the original file will be overwritten.

Steffen

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: How do I....

#3 Post by penpen » 24 Dec 2019 19:38

Another option were to use xslt to change the xml data; example:
viewtopic.php?p=32941#p32941

penpen

tea
Posts: 8
Joined: 14 Oct 2019 11:58

Re: How do I....

#4 Post by tea » 24 Dec 2019 21:53

Thanks guys !

I will play around with each.

Post Reply