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-not_if
 

wgrib2: -not_if

Introduction

The -not_if option returns true or false. If true, then the next "output" option is executed otherwise it isn't. In order to write headers into the output file, "inv_output" options are conditionally executed depending on the flag.

Note, the effects of nesting of -not_if is not defined and the flag is reset after processing the record.

The -not_if option was written so that you can process the file once and create several output files. For example,

old: wgrib2 -match_inv gribfile  >inv
     grep -v " mb:" inv | wgrib2 -i gribfile -grib flx.grb
     grep  " mb:" inv | wgrib2 -i gribfile -grib prs.grb
In the above example, the "mb" fields are written to prs.grb and the rest are written to flx.grb.
new:
     wgrib2 gribfile -not_if " mb:" -grib flx.grb -if " mb:" -grib prs.grb
Note that you can use any number of -if and -not_if options and they use the same output file.
     wgrib2 gribfile -not_if ":surface:" -grib save.grb

Usage

-not_if X

X is a regular expression, returns not X.

See also: -not, -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