hIfIf your GDAL is from 2016 it's time to update.
Your output file format is a GeoTIFF.
The default output format (in GDAL < 2.3) is a GeoTIFF. With your GDAL, if you want an XYZ ascii file, you need to tell GDAL that by specifying the format with the -of
flag.
gdal_translate -of XYZ source.grib target1.xyz
Starting with GDAL 2.3 released in 2018, if not specified, the format is guessed from the file extension.
Note that while gdal_translate
can output multiple bands in general, it can only output multiple bands to formats that support this. However, the XYZ format only supports a single band. So if you try to output multiple bands (with a recent GDAL) you will get the message:
Warning 6: XYZ driver only uses the first band of the dataset.
You can of course specify a different band using a -b
flag, but you still can only output a single band at a time to the XYZ format
gdal_translate -b 1 -of XYZ source.grib target1.xyz
gdal_translate -b 2 -of XYZ source.grib target2.xyz
gdal_translate -b 3 -of XYZ source.grib target3.xyz
gdal_translate -b 4 -of XYZ source.grib target4.xyz
etc...
gdal_translate -b 999 -of XYZ source.grib target999.xyz