19/06/28 21:40:14.22 HXxQ6WhB0.net
>>25
perlスクリプトはこれだけ。
#!/usr/bin/env perl
use strict;
use warnings;
use XML::Simple;
my $xml = new XML::Simple();
if (@ARGV != 1) {
print STDERR "usage: $0 file\n";
exit 1;
}
my $x = $xml->XMLin($ARGV[0]);
my $trans = $x->{NIT}->{TransportStreamID};
my @freqs;
foreach my $elm (@$trans) {
my $freq = $elm->{Descriptor}->[1]->{Frequency}->{Value};
push(@freqs, $freq);
}
my $ch = 0;
foreach my $freq (sort(@freqs)) {
printf "ch%03d=0,%.3f, ,0,%dch\n", $ch, $freq / 1000, $ch + 1;
$ch++;
}