This is an old revision of the document!
#!/usr/bin/perl -w # Dump all flag tables in table file # Author: P.Sannes, met.no 2010-05-12 use strict; use Geo::BUFR; my $table_path = '/usr/local/lib/bufrtables'; my $table = 'B0000000000098013001'; Geo::BUFR->set_tablepath($table_path); my $bufr = Geo::BUFR->new(); $bufr->load_BDtables($table); $bufr->load_Ctable($table); my $B_table = $bufr->{B_TABLE}; my $C_table = $bufr->{C_TABLE}; for my $i (1..50000) { my $desc = sprintf "%06d", $i; next unless $bufr->{C_TABLE}->{$desc}; # Some code/flag tables in C*.TXT were found not to be defined in # the corresponding B*.TXT next unless defined $B_table->{$desc}; my ($name, $unit) = (split /\0/, $B_table->{$desc})[0,1]; next unless $unit =~ /^FLAG TABLE/; print "$desc $name $unit\n"; print $bufr->dump_codetable($desc, $table) }