summaryrefslogtreecommitdiff
path: root/scripts/epgd-ls-channelids
blob: e4f6f3e5eea190292d053506bd8d2c7d9088c954 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl

use strict;
use Getopt::Long;


if (($#ARGV!=0) || (! $ARGV[0]))
{
   print "Usage: $0 <channels.conf>\n";
   exit 1;
}

open CHANNELS, $ARGV[0]
  or die $!;

my(@lines)=<CHANNELS>;

foreach my $line (@lines)
{
  my @column=split(/:/, $line);
  my @name=split(/;/, $column[0]);

  # These are the names and field numbers from channels.conf:
  #
  #   Name: $column[0], Freq: $column[1], Param: $column[2], Src: $column[3], Symb: $column[4],
  #   VPID: $column[5], APID: $column[6], TPID: $column[7], CAID: $column[8], SID: $column[9],
  #   NID: $column[10], TID: $column[11], RID: $column[12]

  # make sure to print the "data lines" only:

  if (($column[3] =~ /^S/) || ($column[3] =~ /C/) || ($column[3] =~ /I/))
  {
    print "$column[3]-$column[10]-$column[11]-$column[9] \/\/ $name[0]\n";
  }


}

close(CHANNELS);