List content of grib files printing values of some keys. It does not fail when a key is not found.
grib_ls [options] grib_file grib_file ...
Declaration of keys to print. For each key a string (key:s), a double (key:d) or an integer (key:i) type can be requested. Default type is string.
C style format for floating point values.
As -p adding the declared keys to the default list.
Where clause. Messages are processed only if they match all the key/value constraints. A valid constraint is of type key=value or key!=value. For each key a string (key:s), a double (key:d) or an integer (key:i) type can be specified. Default type is string. In the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction) Note: only one -w clause is allowed.
-B order by directive
Order by. The output will be ordered according to the order by directive. Order by example: "step:i asc, centre desc" (step numeric ascending and centre descending)
Value close to the point of a Latitude/Longitude. Allowed values for MODE are: 4 (4 values in the nearest points are printed) Default 1 (the value at the nearest point is printed) file (file is used as mask. The closer point with mask value>=0.5 is printed)
Key/values to set. For each key a string (key:s), a double (key:d) or an integer (key:i) type can be defined. By default the native type is set.
Data value corresponding to the given index is printed.
All the keys belonging to namespace are printed.
Mars keys are printed.
Minimum width of each column in output. Default is 10.
Multi-field support off. Turn off support for multiple fields in single grib message.
Copy GTS header.
-T T | B | M | A
Message type. T->GTS, B->BUFR, M->METAR (Experimental),A->Any (Experimental). The input file is interpreted according to the message type.
Does not fail when the message has wrong length
Input file offset in bytes. Processing of the input file will start from "offset".
Fast parsing option, only headers are loaded.
Without options a default list of keys is printed. The default list is different depending on the type of grib message.
To print offset and count number in file use the keys offset and count Also the total count in a set of files is available as countTotal
To list only a subset of messages use the -w (where option). Only the pressure levels are listed with the following line.
All the grib messages not on pressure levels are listed as follows:
To get the closest grid point to a latitude/longitude.
To get a list ordered by the 'level' key (ascending order).
Note: we need to specify the ':i' to get a numerical sort. By default values are sorted as strings so a level of 100 would come before 20!