NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
xbfmg.c File Reference

Split a BUFR file into separate BUFR files by message. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libgen.h>
#include <unistd.h>
#include <sys/stat.h>
#include "bufrlib.h"

Go to the source code of this file.

Macros

#define MXFLEN   125
 

Functions

int main (int argc, char *argv[])
 This program splits a single file containing one or more BUFR messages into one or more BUFR files each containing a single BUFR message. More...
 
void prtusage (char *prgnam)
 This function prints program usage information to standard output. More...
 

Detailed Description

Split a BUFR file into separate BUFR files by message.

Definition in file xbfmg.c.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

This program splits a single file containing one or more BUFR messages into one or more BUFR files each containing a single BUFR message.

The output BUFR files are written to the current working directory, according to a pre-defined naming convention as described below.

Author
J. Ator
Date
2018-03-01

Usage

  xbfmg [-v] [-h] [-g] bufrfile
    where:
      -v        prints version information and exits
      -h        prints program help and usage information and exits
      -g        preserves within each output file any GTS bulletin header
                and control characters associated with the corresponding
                BUFR message from the input file
     bufrfile   [path/]name of input file containing one or more BUFR
                messages to be extracted into separate output files within
                the current working directory
  The output will be stored within the current working directory using
  the following filenames:
     (basename).xbfmg.out.000001
     (basename).xbfmg.out.000002
     (basename).xbfmg.out.000003
       and so on, up through
     (basename).xbfmg.out.(last#)
  where:
     (basename) = basename of bufrfile
     (last#) = total number of BUFR messages in bufrfile

Program history log:

Date Programmer Comments
2018-03-01 J. Ator Original author
2021-09-29 J. Ator Use basename instead of pid in output filenames
2021-10-08 J. Ator Simplify bvstr instantiation and initialization

Definition at line 110 of file xbfmg.c.

References bvers(), iupb(), prtusage(), and wrdlen().

void prtusage ( char *  prgnam)

This function prints program usage information to standard output.

Author
J. Ator
Date
2018-03-01
Parameters
[in]prgnam– char*: [path/]name of program executable

Program history log:

Date Programmer Comments
2018-03-01 J. Ator Original author

Definition at line 35 of file xbfmg.c.

Referenced by main().