There is probably a cleaner approach, but the following should work for you under Linux. Using CDO (Climate Data Operators), you could convert your GRIB file to NetCDF:
cdo -f nc copy input.grb2 output.nc
You could then convert your NetCDF to plain text using ncdump
, e.g.:
ncdump output.nc
You will probably want to review some examples about ncdump
to ensure that you export the parts (and region) of the NetCDF file that you want.
You can install the relevant packages on linux (e.g. Ubuntu as follows)
sudo apt-get install cdo nco netcdf-bin