TV_MERGE(1p)

πŸ“¦
version 1.4.0 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– TV_MERGE πŸ’–

okay so bestie, welcome to tv_merge β€” it lives in the User Contributed Perl Documentation section (1p), and it's literally the glow-up your XMLTV files have been waiting for. ✨


🌸 NAME 🌸

tv_merge β€” merge (combine) two XMLTV files. that's it, that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

tv_merge [-t] -i FILE -m FILE -o FILE

πŸ¦‹ DESCRIPTION πŸ¦‹

so what we're doing here is reading XMLTV listings from two files and merging them together. 🫢

and no, this is not the same as tv_cat β€” tv_cat just joins files like a lazy group project where nobody talks to each other. tv_merge actually updates the original XMLTV file (add / replace / delete, the whole main-character arc πŸ’…) using the channels and programmes it finds in that second file.

it handles multiple channels like a boss πŸ‘‘, and it will insert any new programmes and delete any overlapping ones. lowkey obsessed with how thorough that is.

IMPORTANT 🚨 the input files must be pre-sorted into datetime within channel order, and you do that with the --by-channel option on tv_sort:
tv_sort --by-channel --output FILE FILE

all programmes must have start and stop times, no exceptions, fr fr. ⏰

(also, quick note bestie: programmes in the merged-in file replace any in the master file β€” i.e. data are not updated within programmes. so don't come for me when the insides of a programme don't get touched. πŸ™ˆ)

this program uses XML::TreePP, which doesn't write <DOCTYPE> definitions in the output file. so if you need to add a suitable <DOCTYPE> tag, use the optional -t parameter:

tv_merge -t -i FILE -m FILE -o FILE

🌈 EXAMPLE 🌈

say you wanna merge all channels/programmes in newadditions.xml into master.xml, and write the output to newmaster.xml with a DOCTYPE tag. iconic. do this:

tv_merge -t -i master.xml -m newadditions.xml -o newmaster.xml

πŸ’œ SEE ALSO πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Copyright Geoff Westcott, February 2013.

this code is distributed under the GNU General Public License v2 (GPLv2). slay, legally. πŸ’…


and that's the tea, bestie β€” go merge those files. this page was served fresh by perl v5.40.1 on 2025-04-19 (the TV_MERGE(1p) energy we all know and love). mwah. πŸ“πŸ’–

πŸ“¦ where this page comes from