Break On ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $File - Enter the full path to the file you want to extract ; ; channel data from in quotes. ; ; E.G. $XMLTVFiles="c:\xmltv\1.xml" ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $File="c:\xmltv\1.xml" Open(1,$File) Open(2,"c:\Program Files\SageTV\SageTV\xmltv_channel_ids.txt",5) Do $chanidpre=Readline(1) IF instr($chanidpre,"channel id=") IF instr($chanidpre,"www.mtepgdplu.com") $Longpre=Readline(1) $numberpre=Readline(1) $Shortpre=Readline(1) Else Readline(1) Readline(1) $numberpre=Readline(1) $Shortpre=Readline(1) $Longpre=Readline(1) ENDIF $chanidspl=split($chanidpre,'"') $chanid=$chanidspl[1] $numbersplpre=split($numberpre,">") $numberspl=split($numbersplpre[1],"<") $number=$numberspl[0] $shortsplpre=split($shortpre,">") $shortspl=split($shortsplpre[1],"<") $short=$shortspl[0] IF instr($short," ") $shortsplpost=split($shortspl[0]) $short=$shortsplpost[1] ENDIF $longsplpre=split($longpre,">") $longspl=split($longsplpre[1],"<") $long=$longspl[0] Writeline(3,$chanid+",") WriteLine(2,"channel.$chanid.numbers=$number"+ @CRLF) WriteLine(2,"channel.$chanid.names=$short, $long"+ @CRLF) ENDIF Until instr($chanidpre,"