<p>Just to expand upon my comments:</p>

<p><a href="http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/problems.html" rel="nofollow noreferrer">This page from CPC</a> suggests that the error message is likely due to wgrib2 thinking subsequent arguments are actually additional grib files because they aren't properly given the <strong>-</strong> prefix.  That lead me to realize that you have a space between your last dash and grib which appears to cause the error:</p>

<blockquote>
  <p>wgrib2 gfst.grb2 -match ":(APCP):" - grib gfst.grb2.small</p>
</blockquote>

<p>should be</p>

<blockquote>
  <p>wgrib2 gfst.grb2 -match ":(APCP):" <strong>-grib</strong> gfst.grb2.small</p>
</blockquote>

<p>Hopefully that helps if anyone else comes across the issue at a later date!  You might also have forgotten a dash somewhere... or tried using too many arguments in an option?</p>

CC BY-SA 4.0
2018-07-31T12:23:19.140Z
2018-07-31T20:44:42.487Z
2018-07-31T20:44:42.487Z
JeopardyTempest
<p>I'm trying to extract the APCP variable from a GFS file, with this code:</p>

<pre><code>wgrib2 gfst.grb2 -match ":(APCP):"  - grib gfst.grb2.small
</code></pre>

<p>I get a </p>

<pre><code>FATAL ERROR: too many grib files .. 1st=gfst.grb2 2nd=-
</code></pre>

<p>What am I doing wrong?</p>

<meteorology>
Extract a GFS variable
rafaela magalhaes
# Extract a GFS variable

(Asked by: username_0 on 2018-07-30)

I'm trying to extract the APCP variable from a GFS file, with this code:

```
wgrib2 gfst.grb2 -match ":(APCP):"  - grib gfst.grb2.small

```

I get a

```
FATAL ERROR: too many grib files .. 1st=gfst.grb2 2nd=-

```

What am I doing wrong?

**Tags:** meteorology


---

## 1 answers

### Answer by username_1 on 2018-07-31. Score: 1

Just to expand upon my comments:

[This page from CPC](http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/problems.html) suggests that the error message is likely due to wgrib2 thinking subsequent arguments are actually additional grib files because they aren't properly given the **-** prefix. That lead me to realize that you have a space between your last dash and grib which appears to cause the error:

> wgrib2 gfst.grb2 -match ":(APCP):" - grib gfst.grb2.small

should be

> wgrib2 gfst.grb2 -match ":(APCP):" **-grib** gfst.grb2.small

Hopefully that helps if anyone else comes across the issue at a later date! You might also have forgotten a dash somewhere... or tried using too many arguments in an option?


---

