summaryrefslogtreecommitdiff
path: root/scripts/extract_vdr_chan_ids.pl
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2012-11-30 13:53:29 +0100
committerDimitar Petrovski <dimeptr@gmail.com>2012-11-30 13:53:29 +0100
commitc0c90a946c0f5a6722f312e7156ba01c9e743d56 (patch)
treedc984296d4eda579f9632ee032bf1a62266bcc40 /scripts/extract_vdr_chan_ids.pl
parent16676f55d7aabc55a7b2894dbdf79a462749767f (diff)
parent250c584c8b52ca6fadc75acc1f8f9e6c2830c014 (diff)
downloadvdr-plugin-eepg-c0c90a946c0f5a6722f312e7156ba01c9e743d56.tar.gz
vdr-plugin-eepg-c0c90a946c0f5a6722f312e7156ba01c9e743d56.tar.bz2
Merge branch 'experimental'
Conflicts: eepg.c
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"
+
+}
+