summaryrefslogtreecommitdiff
path: root/scripts/extract_vdr_chan_ids.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/extract_vdr_chan_ids.pl')
-rwxr-xr-xscripts/extract_vdr_chan_ids.pl38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/extract_vdr_chan_ids.pl b/scripts/extract_vdr_chan_ids.pl
new file mode 100755
index 0000000..e40bbb9
--- /dev/null
+++ b/scripts/extract_vdr_chan_ids.pl
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+#
+# extract VDR channel ID's from channels conf
+#
+
+use strict;
+use File::Path;
+
+my $channelsConf = "../channels.conf";
+my $Usage = qq{
+Usage: $0 (default: ../channels.conf)
+ $0 /path/to/channels.conf
+};
+
+$channelsConf = "@ARGV" if @ARGV;
+
+#my $file;
+open(MYINPUTFILE, "<$channelsConf") or die("Could not open $channelsConf" . $Usage);
+
+foreach (<MYINPUTFILE>)
+{
+ chomp;
+ if ( /^:.*/ )
+ {
+ print $_ . "\n";
+ next;
+ }
+
+ my($line) = $_;
+
+ my(@tokens) = split(":");
+
+ my($chanID) = "$tokens[3]-$tokens[10]-$tokens[11]-$tokens[9] $tokens[0]";
+
+ print $chanID . "\n"
+
+}
+