TV_SORT(1)
π NAME π
okay so bestie, this is tv_sort β the lil tool that sorts your XMLTV listings files by date and adds in the stop times for you β¨ (it's a user-contributed Perl thing, so you know it's got range π
)
β¨ SYNOPSIS β¨
tv_sort [--help] [--by-channel] [--output FILE] [FILE...]
π¦ DESCRIPTION π¦
So here's the vibe: it reads XMLTV data and writes out that exact same data, just sorted in date order. That's it, that's the whole main character energy π
And where the stop times of programmes are missing? It literally guesses them from the start time of the next programme on the same channel πΈ. But bestie, hear me β for the last programme of a channel, no stop time can be added. None. Nada. Not possible π
tv_sort also does some sanity checks while it's in there, like making sure no two programmes on the same channel overlap. Very "vibe check the timeline" of it, no cap π
--output FILEβ writes to FILE instead of standard output π--by-channelβ sorts first by channel id, then by date within each channel π--duplicate-errorβ if the input contains the same programme more than once, this considers that an error π₯. The default is to silently ignore duplicate entries (much more chill of it, ngl)--helpβ you know what this does, queen π«Ά
The time sorting goes by start time, then by stop time. Without --by-channel, if start times and stop times are equal then two programmes get sorted by internal channel id. With --by-channel, channel id gets compared first and then the times. Order of operations, iconic π
You can think of tv_sort as converting XMLTV data into a canonical form β which is lowkey so useful for diffing two files π
π EXAMPLES π
At a typical Unix shell or Windows command prompt:
tv_sort <in.xml >out.xml
tv_sort in.xml --output out.xml
These are literally different ways of saying the same thing, iykyk π
πΈ AUTHOR πΈ
Ed Avis, ed@membled.com β give her a follow, she ate π
and that's the whole page bestie, ty for coming to my TED talk π§ this one's perl v5.42.2, dated 2025-06-30, so go forth and sort those listings ππ
π¦ where this page comes from
- alpine 3.24: xmltv-doc 1.4.0-r1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms