EPG Genre Mapping (2 Viewers)

gonzo90017

Portal Pro
September 3, 2012
238
26
27
Home Country
United States of America United States of America
It's kind of working for me. This is what my batch file looks like:
cscript //NoLogo getcat.vbs C:\xml\xmltv.xml C:\xml\xmltvmp.xml

The problem is that getcat.vbs wont run unless xmltvmp.xml is present before hand.
This doesn't happen with the 1st version of the script.

Also I tried adding "Kids" and "Children" to the script:
Code:
Const ForReading = 1
Const ForWriting = 2
Const TristateUseDefault = -2, TristateTrue = 1, TristateFalse = 0

' input files from argment, open file for reading
strRdFile = WScript.Arguments.Item(0)
strWrFile = WScript.Arguments.Item(1)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strRdFile, ForReading)
Set objWrFile = objFSO.OpenTextFile(strWrFile, ForWriting)

intCnt = 0
strSavedCat = "                <category>None</category>"

Do Until objFile.AtEndOfStream
    strLine = objFile.ReadLine

'**********************
' top half, for lines that are NOT "category"
'**********************
    If InStr(strLine, "<category") = 0 Then

        '*** check if there is a saved "category", do echo to write to file
        '*** reset state until finding the next "category"
        If intCnt > 0 Then
            objWrFile.Write strSavedCat & vbCrLf
            intCnt = 0
            strSavedCat = "                <category>None</category>"
        End If
    
        '*** echo lines from tvguide.xml and write to file
        objWrFile.Write strLine & vbCrLf

    Else
    '**********************
    ' bottom half, for lines that ARE "category"
    '**********************
        intCnt = intCnt + 1

        '*** save junk category if saved = "None"
        If InStr(strLine, "Series") Or InStr(strLine, "General") Or InStr(strLine, "Other")Then
            If InStr(strSavedCat, "None") Then
                strSavedCat = strLine
            End If
        '*** ignore Episodic
        ElseIf InStr(strLine, "Episodic") Then
        '*** always save Movie, overwrite Drama, Action, etc
        ElseIf InStr(strLine, "Movie") Then
            strSavedCat = strLine
        Else
            '*** check if saved = "good" catergory, don't overwrite "good", add more ElseIf to add "good"
            If InStr(strSavedCat, "Drama") Or InStr(strSavedCat, "Action")Then
            ElseIf InStr(strSavedCat, "Current") Or InStr(strSavedCat, "Comedy")Then
            ElseIf InStr(strSavedCat, "Movie") Then
            ElseIf InStr(strSavedCat, "Football") Or InStr(strSavedCat, "Basketball") Then
            ElseIf InStr(strSavedCat, "Soccer") Or InStr(strSavedCat, "Golf")Then
            ElseIf InStr(strSavedCat, "Children") Or InStr(strSavedCat, "Kids")Then
            Else
                '*** saved = new categoruy
                strSavedCat = strLine
            End If
        End If
    End If
Loop
objFile.Close
objWrFile.Close

So I can keep those categories:
Code:
<programme start="20140124040000 -0800" stop="20140124043000 -0800" channel="I30.2.190198069.microsoft.com">
        <title lang="en">Eliot Kid *</title>
        <sub-title lang="en">The Bathroom Monster; Igor</sub-title>
        <desc lang="en">Eliot thinks an army of monsters is lurking under the city; Eliot's sister has fallen in love with a guitar player.</desc>
        <category lang="en">Action/Adventure</category>
        <category lang="en">Adventure</category>
        <category lang="en">Children</category>
        <category lang="en">Comedy</category>
        <category lang="en">Family/Children</category>
        <category lang="en">General</category>
        <category lang="en">Kids</category>
        <category lang="en">Series</category>
        <episode-num system="ms_progid">1.293936069</episode-num>
        <episode-num system="onscreen">126</episode-num>
        <audio>
            <stereo>stereo</stereo>
        </audio>
        <new />
        <rating system="VCHIP">
            <value>TV-Y7</value>
        </rating>
    </programme>

But it's not working:
Code:
<programme start="20140124040000 -0800" stop="20140124043000 -0800" channel="I30.2.190198069.microsoft.com">
        <title lang="en">Eliot Kid *</title>
        <sub-title lang="en">The Bathroom Monster; Igor</sub-title>
        <desc lang="en">Eliot thinks an army of monsters is lurking under the city; Eliot's sister has fallen in love with a guitar player.</desc>
        <category lang="en">Action/Adventure</category>
        <episode-num system="ms_progid">1.293936069</episode-num>
        <episode-num system="onscreen">126</episode-num>
        <audio>
            <stereo>stereo</stereo>
        </audio>
        <new />
        <rating system="VCHIP">
            <value>TV-Y7</value>
        </rating>
    </programme>
[DOUBLEPOST=1389664116][/DOUBLEPOST]EDIT
I guess I added "Kids" to the wrong section. After adding it to:

Code:
        '*** always save Movie, overwrite Drama, Action, etc
        ElseIf InStr(strLine, "Movie") Then
        ElseIf InStr(strLine, "Kids") Then
            strSavedCat = strLine
        Else
It's no longer stripping it from the xml file.
 
Last edited:

RonD

Test Group
  • Team MediaPortal
  • December 20, 2011
    911
    278
    SillyValley CA
    Home Country
    United States of America United States of America
    found what I was doing wrong with creating the temp file. try this version.

    when I did testing I saw at least some programs with "kids", but did not really look at the detail closely, don't have kids. you'll need to tweak the file I uploaded with your changes.

    EDIT Jan 14, removed script from this message, see message #6 in this thread for current version
     
    Last edited:

    gonzo90017

    Portal Pro
    September 3, 2012
    238
    26
    27
    Home Country
    United States of America United States of America
    This version seems to be working a lot better. I decided to add "Children" in order to keep that category. In took me a while to figure it out but these are my results:
    Original xml file:
    Code:
    <programme start="20140113200000 -0800" stop="20140113203000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Archie's Weird Mysteries</title>
            <sub-title lang="en">Twisted Youth</sub-title>
            <date>20021129</date>
            <category lang="en">Children</category>
            <category lang="en">Family/Children</category>
            <category lang="en">General</category>
            <category lang="en">Kids</category>
            <category lang="en">Other</category>
            <category lang="en">Sci-Fi/Fantasy</category>
            <category lang="en">Series</category>
            <episode-num system="ms_progid">1.27810983</episode-num>
            <episode-num system="onscreen">39</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20021129000000" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>
        <programme start="20140113203000 -0800" stop="20140113210000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Sherlock Holmes in the 22nd Century</title>
            <sub-title lang="en">The Crime Machine</sub-title>
            <desc lang="en">Holmes, Watson and Lestrade discover a makeshift lab where Fenwick is turning ordinary citizens into criminals.</desc>
            <credits>
                <actor>Jason Gray-Stanford</actor>
                <actor>John Payne</actor>
                <actor>Akiko Morison</actor>
                <actor>Viv Leacock</actor>
                <actor>Jennifer Copping</actor>
                <actor>Richard Newman</actor>
                <actor>Ian James Corlett</actor>
                <actor>William Samples</actor>
                <actor>Jo Bates</actor>
                <writer>Martha Moran</writer>
            </credits>
            <date>20010304</date>
            <category lang="en">Action/Adventure</category>
            <category lang="en">Adventure</category>
            <category lang="en">Children</category>
            <category lang="en">Family/Children</category>
            <category lang="en">General</category>
            <category lang="en">Kids</category>
            <category lang="en">Series</category>
            <episode-num system="ms_progid">1.28410924</episode-num>
            <episode-num system="onscreen">3</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20010304000000" />
            <subtitles type="teletext" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>

    After running it through to getcat.vbs (No modifcations):
    Code:
    <programme start="20140115200000 -0800" stop="20140115203000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Archie's Weird Mysteries</title>
            <sub-title lang="en">Supreme Girl vs. Dr. Arachnid</sub-title>
            <date>20020606</date>
            <category lang="en">Sci-Fi/Fantasy</category>
            <episode-num system="ms_progid">1.38150884</episode-num>
            <episode-num system="onscreen">4</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20020606000000" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>
        <programme start="20140115203000 -0800" stop="20140115210000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Sherlock Holmes in the 22nd Century</title>
            <sub-title lang="en">The Adventure of the Empty House</sub-title>
            <desc lang="en">Holmes reappears in London after his alleged demise.</desc>
            <credits>
                <actor>Jason Gray-Stanford</actor>
                <actor>John Payne</actor>
                <actor>Akiko Morison</actor>
                <actor>Viv Leacock</actor>
                <actor>Jennifer Copping</actor>
                <actor>Richard Newman</actor>
                <actor>Ian James Corlett</actor>
                <actor>William Samples</actor>
                <actor>Jo Bates</actor>
                <writer>Marv Wolfman</writer>
            </credits>
            <date>20010624</date>
            <category lang="en">Action/Adventure</category>
            <episode-num system="ms_progid">1.28388752</episode-num>
            <episode-num system="onscreen">21</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20010624000000" />
            <subtitles type="teletext" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>

    As you can see it strips out the "Children's" category which I want to keep. So I decide to add "Children" to the script:
    Code:
                End If
            '*** ignore Episodic
            ElseIf InStr(strLine, "Episodic") Then
            '*** always save Movie, overwrite Drama, Action, etc
            ElseIf InStr(strLine, "Movie") Then
                strSavedCat = strLine
            ElseIf InStr(strLine, "Children") Then
                strSavedCat = strLine
            Else

    Output:
    Code:
    <programme start="20140113200000 -0800" stop="20140113203000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Archie's Weird Mysteries</title>
            <sub-title lang="en">Twisted Youth</sub-title>
            <date>20021129</date>
            <category lang="en">Sci-Fi/Fantasy</category>
            <episode-num system="ms_progid">1.27810983</episode-num>
            <episode-num system="onscreen">39</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20021129000000" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>
        <programme start="20140113203000 -0800" stop="20140113210000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Sherlock Holmes in the 22nd Century</title>
            <sub-title lang="en">The Crime Machine</sub-title>
            <desc lang="en">Holmes, Watson and Lestrade discover a makeshift lab where Fenwick is turning ordinary citizens into criminals.</desc>
            <credits>
                <actor>Jason Gray-Stanford</actor>
                <actor>John Payne</actor>
                <actor>Akiko Morison</actor>
                <actor>Viv Leacock</actor>
                <actor>Jennifer Copping</actor>
                <actor>Richard Newman</actor>
                <actor>Ian James Corlett</actor>
                <actor>William Samples</actor>
                <actor>Jo Bates</actor>
                <writer>Martha Moran</writer>
            </credits>
            <date>20010304</date>
            <category lang="en">Kids</category>
            <episode-num system="ms_progid">1.28410924</episode-num>
            <episode-num system="onscreen">3</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20010304000000" />
            <subtitles type="teletext" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>

    As you can see Archie's Weird Mysteries remains unchanged but Sherlock in the 22nd Century changed from Action/Adventure to Kids. Even though I never added Kids to my keep category.

    So I run it again but this time I add Children to the bottom part of the script:
    Code:
    '**********************
        ' bottom half, for lines that ARE "category"
        '**********************
            intCnt = intCnt + 1
    
            '*** save junk category if saved = "None"
            If InStr(strLine, "Series") Or InStr(strLine, "General") Or InStr(strLine, "Other")Then
                If InStr(strSavedCat, "None") Then
                    strSavedCat = strLine
                End If
            '*** ignore Episodic
            ElseIf InStr(strLine, "Episodic") Then
            '*** always save Movie, overwrite Drama, Action, etc
            ElseIf InStr(strLine, "Movie") Then
                strSavedCat = strLine
            Else
                '*** check if saved = "good" catergory, don't overwrite "good", add more ElseIf to add "good"
                If InStr(strSavedCat, "Drama") Or InStr(strSavedCat, "Action")Then
                ElseIf InStr(strSavedCat, "Current") Or InStr(strSavedCat, "Comedy")Then
                ElseIf InStr(strSavedCat, "Movie") Then
                ElseIf InStr(strSavedCat, "Football") Or InStr(strSavedCat, "Basketball") Then
                ElseIf InStr(strSavedCat, "Soccer") Or InStr(strSavedCat, "Golf")Then
                ElseIf InStr(strSavedCat, "Children")Then
                Else
                    '*** saved = new categoruy

    Output:
    Code:
    <programme start="20140113200000 -0800" stop="20140113203000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Archie's Weird Mysteries</title>
            <sub-title lang="en">Twisted Youth</sub-title>
            <date>20021129</date>
            <category lang="en">Children</category>
            <episode-num system="ms_progid">1.27810983</episode-num>
            <episode-num system="onscreen">39</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20021129000000" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>
        <programme start="20140113203000 -0800" stop="20140113210000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Sherlock Holmes in the 22nd Century</title>
            <sub-title lang="en">The Crime Machine</sub-title>
            <desc lang="en">Holmes, Watson and Lestrade discover a makeshift lab where Fenwick is turning ordinary citizens into criminals.</desc>
            <credits>
                <actor>Jason Gray-Stanford</actor>
                <actor>John Payne</actor>
                <actor>Akiko Morison</actor>
                <actor>Viv Leacock</actor>
                <actor>Jennifer Copping</actor>
                <actor>Richard Newman</actor>
                <actor>Ian James Corlett</actor>
                <actor>William Samples</actor>
                <actor>Jo Bates</actor>
                <writer>Martha Moran</writer>
            </credits>
            <date>20010304</date>
            <category lang="en">Action/Adventure</category>
            <episode-num system="ms_progid">1.28410924</episode-num>
            <episode-num system="onscreen">3</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20010304000000" />
            <subtitles type="teletext" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>

    This time Archie's Weird Mysteries changed to Children as I had hoped. But Sherlock in the 22nd Century changed to Action/Adventure.

    So thing that finally did the trick was to add Children to both the top and bottom of the script:
    Code:
    '*** ignore Episodic
            ElseIf InStr(strLine, "Episodic") Then
            '*** always save Movie, overwrite Drama, Action, etc
            ElseIf InStr(strLine, "Movie") Then
                strSavedCat = strLine
            ElseIf InStr(strLine, "Children") Then
                strSavedCat = strLine
            Else
                '*** check if saved = "good" catergory, don't overwrite "good", add more ElseIf to add "good"
                If InStr(strSavedCat, "Drama") Or InStr(strSavedCat, "Action")Then
                ElseIf InStr(strSavedCat, "Current") Or InStr(strSavedCat, "Comedy")Then
                ElseIf InStr(strSavedCat, "Movie") Then
                ElseIf InStr(strSavedCat, "Football") Or InStr(strSavedCat, "Basketball") Then
                ElseIf InStr(strSavedCat, "Soccer") Or InStr(strSavedCat, "Golf")Then
                ElseIf InStr(strSavedCat, "Children")Then
                Else
                    '*** saved = new categoruy
                    strSavedCat = strLine
                End If

    Output:
    Code:
    <programme start="20140113200000 -0800" stop="20140113203000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Archie's Weird Mysteries</title>
            <sub-title lang="en">Twisted Youth</sub-title>
            <date>20021129</date>
            <category lang="en">Family/Children</category>
            <episode-num system="ms_progid">1.27810983</episode-num>
            <episode-num system="onscreen">39</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20021129000000" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>
        <programme start="20140113203000 -0800" stop="20140113210000 -0800" channel="I30.2.190198069.microsoft.com">
            <title lang="en">Sherlock Holmes in the 22nd Century</title>
            <sub-title lang="en">The Crime Machine</sub-title>
            <desc lang="en">Holmes, Watson and Lestrade discover a makeshift lab where Fenwick is turning ordinary citizens into criminals.</desc>
            <credits>
                <actor>Jason Gray-Stanford</actor>
                <actor>John Payne</actor>
                <actor>Akiko Morison</actor>
                <actor>Viv Leacock</actor>
                <actor>Jennifer Copping</actor>
                <actor>Richard Newman</actor>
                <actor>Ian James Corlett</actor>
                <actor>William Samples</actor>
                <actor>Jo Bates</actor>
                <writer>Martha Moran</writer>
            </credits>
            <date>20010304</date>
            <category lang="en">Family/Children</category>
            <episode-num system="ms_progid">1.28410924</episode-num>
            <episode-num system="onscreen">3</episode-num>
            <audio>
                <stereo>stereo</stereo>
            </audio>
            <previously-shown start="20010304000000" />
            <subtitles type="teletext" />
            <rating system="VCHIP">
                <value>TV-Y7</value>
            </rating>
        </programme>

    I'm sure that's the way the script works but i'm just putting it out there in case anyone else like me who has no idea what they're doing comes along :)

    (Don't know why it's keeping Family/Children instead of just Children but as long Children is in there i'm happy)
     

    DaltonST

    MP Donator
  • Premium Supporter
  • December 16, 2012
    5
    1
    Home Country
    United States of America United States of America
    Nobody has this issue?

    I have been using mc2xml for 2 years, and from the beginning used sed.exe on Windows 8 to change some symbols for Repeats [R] and News [NEWS]. Since I was using sed.exe anyway, I just added some more lines to my .bat file that runs mc2xml.exe and then sed.exe to clean up the EPG categories to my taste (my kids are all adults now). Examples shown below. These are obviously personal to me, but can easily be modified to suit yourself. Using sed.exe is not as powerful as writing a .vbs script, but it sure is simple and easy. Not perfect, but almost close enough for my purposes.

    http://gnuwin32.sourceforge.net/packages/sed.htm

    To make changes that sed.exe cannot, I wrote a VBS script that is a generic template to manage EPG categories. I wrote it originally to put Movies as the first category so MediaPortal would properly classify Movies, but it is generic and easily customizable. See the attached file with a .txt extension that is really a .vbs file.


    Part of my mc2xml.bat file that runs once a day for mc2xmldonator.exe, sed.exe, and vbs:
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    c:
    cd c:\mc2xml

    c:\mc2xml\mc2xmldonator.exe -b -c US -F -g 10001 -D mc2xml.dat -C mc2xml.chl -I xmltv.xml -o input.xml

    c:
    cd "C:\Program Files (x86)\GnuWin32\bin"

    sed.exe -e "/<title lang=/ s/"*"/[R]/g" <"C:\mc2xml\input.xml" >"C:\mc2xml\tvguidetmp1.xml"
    sed.exe -e "/.*News.*"[R]"/ s/"[R]"/"NEWS"/g" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<title lang=/ s/ABC World News Now.*</ABC Early News [NEWS]</g" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"
    sed.exe -e "/<title lang=/ s/ABC World News.*</ABC World News [NEWS]</g" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"
    sed.exe -e "/<title lang=/ s/NBC Nightly News.*</NBC Nightly News [NEWS]</g" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<title lang=/ s/CBS Evening News.*</CBS Evening News [NEWS]</g" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"

    REM Delete meaningless categories that are redundant
    sed.exe -e "/<category lang.*Series/d" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"
    sed.exe -e "/<category lang.*Lifestyle/d"<"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<category lang.*General/d" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"
    sed.exe -e "/<category lang.*Soap/d" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"

    REM Delete categories that are not desired
    sed.exe -e "/<category lang.*Basketball<.*/d" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<category lang.*Football<.*/d" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"
    sed.exe -e "/<category lang.*Baseball<.*/d" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"

    sed.exe -e "/<category lang.*Action and Adventure<*/d" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<category lang.*Action.*/d" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"
    sed.exe -e "/<category lang.*Suspense<.*/d" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"

    sed.exe -e "/<category lang.*Fantasy<*/d" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<category lang.*Horror<.*/d" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"
    sed.exe -e "/<category lang.*Sci-Fi*<.*/d" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"

    sed.exe -e "/<category lang.*Western<.*/d" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<category lang.*Horror<.*/d" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"
    sed.exe -e "/<category lang.*Science Fiction<.*/d" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"

    sed.exe -e "/<category lang.*Talk.*<.*/d" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<category lang.*Sci.*<.*/d" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"
    sed.exe -e "/<category lang.*Golf<.*/d" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"

    REM Change various to some other category
    sed.exe -e "/<category lang=/ s/Public Affairs.*</News</g" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<category lang=/ s/Current Events.*</News</g" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"

    REM Change various to Pablum for later mass delete
    sed.exe -e "/<category lang=/ s/Game Show.*</Pablum</g" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"
    sed.exe -e "/<category lang=/ s/Religious.*</Pablum</g" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<category lang=/ s/Kids.*</Pablum</g" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"
    sed.exe -e "/<category lang=/ s/Children.*</Pablum</g" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"
    sed.exe -e "/<category lang=/ s/Family*Children.*</Pablum</g" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    sed.exe -e "/<category lang=/ s/Reality.*</Pablum</g" <"C:\mc2xml\tvguidetmp2.xml" >"C:\mc2xml\tvguidetmp3.xml"

    REM Now mass delete Pablum and Other
    sed.exe -e "/<category lang.*Pablum/d" <"C:\mc2xml\tvguidetmp3.xml" >"C:\mc2xml\tvguidetmp1.xml"
    sed.exe -e "/<category lang.*Other/d" <"C:\mc2xml\tvguidetmp1.xml" >"C:\mc2xml\tvguidetmp2.xml"
    copy C:\mc2xml\tvguidetmp2.xml C:\mc2xml\tvguide_draft.xml

    c:
    cd c:\mc2xml
    C:\Windows\System32\cscript.exe //NoLogo "C:\mc2xml\EPG_Category_Cleaner.vbs" "c:\mc2xml\tvguide_draft.xml" "c:\mc2xml\tvguide.xml"

    REM clean up temporary work files
    del C:\mc2xml\tvguidetmp1.xml
    del C:\mc2xml\tvguidetmp2.xml
    del C:\mc2xml\tvguidetmp3.xml
    del C:\mc2xml\tvguide_draft.xml

    -------------------------------------------------------------------------------------------------------------------------------------------------------------
     

    Attachments

    • EPG_Category_Cleaner_vbs.txt
      10.2 KB
    Last edited:

    Users who are viewing this thread

    Top Bottom