Re: Can you create +1 channels?

"Mike Smith" <[email protected]> Sat, 28 Jan 2017 22:01:30 +0100
Newsgroups gmane.comp.tv.xmltv.general
Message-ID <trinity-b6c412dc-d5af-4803-852a-83252c6db293-1485637290634@3capp-mailcom-lxa10>
> 1) Assuming your existing XMLTV file (e.g. tvdatafile.xml) contains multiple channels, you need to extract the one you want to shift.
> 
>   tv_grep  --channel-id '12345'  --output tempfile  tvdatafile.xml
> 
> 2) edit the temporary file to change the time offset and the channel id
> 
>   sed  -i  's/12345/12345\+1h/g'  tempfile  
>   sed  -i  's/ \+0000"/ \-0001"/g'  tempfile  
> 
> 3) Append the new +1 channel file onto your original file
> 
>   tv_cat  --output  tvdatafileNEW.xml   tvdatafile.xml  tempfile  

Thanks for help Geoff.  Made a couple of changes to make it a bit more specific to avoid changing other text, -0100 for the hour offset and duplicate channel information.  Extremely slow at the tv_grep stage do not know why but it works.

Does anyone have any tips on if I want to remove data dependant on the time so I can create a channel with only programmes between 17:00 and 23:00?

This is what I have so far for +1 - use at own risk!

tv_grep --output plus.xml --channel-id 12345 in.xml
sed -i 's/id="12345"/id="12345+1"/g' plus.xml
sed -i 's/channel="12345"/channel="12345+1"/g' plus.xml
sed -i 's/+0000/-0100/g' plus.xml
tv_cat --output new.xml in.xml plus.xml

Cheers

Mike

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot