Skip Navigation Links www.nws.noaa.gov 
NOAA logo - Click to go to the NOAA home page National Weather Service   NWS logo - Click to go to the NWS home page
Climate Prediction Center
 
 

 
About Us
   Our Mission
   Who We Are

Contact Us
   CPC Information
   CPC Web Team

 
HOME > Monitoring_and_Data > Oceanic and Atmospheric Data > Reanalysis: Atmospheric Data > wgrib2-match
 

wgrib2: -match

Introduction

The -match option selects records which should be processed. When multiple -match options are used, all matches must be satisfied. The -match and -not options seem to be similar to the -if and -if_not options. The big difference is that the -match and -not options are processed before any other record processing. If the record satisfies the -match and -not options, then the record is processed. This include the optional decoding and latitude-longitude calculation and the other options.


    wgrib2 -match X (...)

is the same as 

    wgrib2 -match_inv file | egrep X | wgrib2 -i (...)



    wgrib2 -match X -match Y -not Z (...)

is the same as 

    wgrib2 -match_inv file | egrep X | egrep Y | egrep -v Z | wgrib2 -i (...)

where X, Y and Z are regular expressions. 

Usage

-match X

X is a posix extended regular expression

The -match, and -not selection facility is more limited than the "wgrib2 | filter | wgrib2 -i" syntax. However, it can be more efficient especially when combined with the -end option. Note that the "match" inventory often expands. Usually the inventory expands by adding new items to the end of the inventory in order not the break scripts.

See also: -not, -match_inv, -end, -i. -if.


NOAA/ National Weather Service
National Centers for Environmental Prediction
Climate Prediction Center
5200 Auth Road
Camp Springs, Maryland 20746
Climate Prediction Center Web Team
Page last modified: May 15, 2005
Disclaimer Privacy Policy