GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
BUFREXTRACT(1) User Contributed Perl Documentation BUFREXTRACT(1)

  bufrextract.pl <bufr file(s)>
      [--ahl <ahl_regexp>]
      [--only_ahl] | [--without_ahl] | [--gts]
      [--outfile <filename>]
      [--help]
      [--verbose n]

Extract all BUFR messages and/or corresponding AHLs from BUFR file(s), possibly filtering on AHL.

The AHL (Abbreviated Header Line) is recognized as the TTAAii CCCC YYGGgg [BBB] immediately preceding the BUFR message.

Execute without arguments for Usage, with option "--help" for some additional info. See also <https://wiki.met.no/bufr.pm/start> for examples of use.

   --ahl <ahl_regexp> Extract BUFR messages and/or AHLs with AHL
                      matching <ahl_regexp> only
   --gts              Include full gts message envelope if present
   --only_ahl         Extract AHLs only
   --without_ahl      Extract BUFR messages only
   --outfile <filename>
                      Will print to <filename> instead of STDOUT
   --help             Display Usage and explain the options used. For even
                      more info you might prefer to consult perldoc bufrextract.pl
   --verbose n        Set verbose level to n, 0<=n<=6 (default 0)

Options may be abbreviated, e.g. "--h" or "-h" for "--help".

For option "--ahl" the <ahl_regexp> should be a Perl regular expression. E.g. "--ahl 'ISS... ENMI'" will decode only BUFR SHIP (ISS) from CCCC=ENMI.

Use option "--gts" if you want the full GTS message envelope (if present) to be included in output. There are 2 main variations on this envelope: SOH/ETX and ZCZC/NNNN notation, see the Manual on the GTS: Attachment II-4 Format of Meteorological Messages. Only SOH/ETX is supported in bufrextract.pl, since ZCZC/NNNN is no longer used in modern data exchange.

No bufrtables are needed for running bufrextract.pl, since section 4 in BUFR message will not be decoded (which also speeds up execution quite a bit).

With a little knowledge of Perl you could easily extend bufrextract.pl to extract BUFR messages based on whatever information is available in section 0-3, by making your own copy of bufrextract.pl and then employing one of the many "get_" subroutines in BUFR.pm. For example, to extract only BUFR messages with data category 1, add the following line just before calling is_filtered() in code:

  next if $bufr->get_data_category() != 1;

Or to extract BUFR messages with TM315009 only:

  next if bufr->get_descriptors_unexpanded() ne '315009';

Sometimes GTS bulletins are erroneously issued with extra characters between the GTS AHL and the start of BUFR message (besides the standard character sequence CRCRLF), likely leading bufrextract.pl to miss the AHL.

Pål Sannes <pal.sannes@met.no>

Copyright (C) 2010-2023 MET Norway

2025-07-04 perl v5.40.2

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.