GDXDUMPExample1.gms : GDXDUMP - Adding double Quotes to an user defined Header when writing to CSV

Description

This model demonstrates a workaround on how to add double quotes to an user defined
header when writing data from GDX to CSV using GDXDump. Note that the header
option cannot be used to add the double quotes!

This model is referenced in "Adding double Quotes to an user defined Header
when writing to CSV" from the GDXDUMP Documentation.


Category : GAMS Data Utilities library


Main file : GDXDUMPExample1.gms   includes :  trnsport.gms  GDXDUMPExample1.gms

$title GDXDUMP - Adding double Quotes to an user defined Header when writing to CSV (GDXDUMPExample1,SEQ=124)

$onText
This model demonstrates a workaround on how to add double quotes to an user defined
header when writing data from GDX to CSV using GDXDump. Note that the header
option cannot be used to add the double quotes!

This model is referenced in "Adding double Quotes to an user defined Header
when writing to CSV" from the GDXDUMP Documentation.
$offText

$call gams trnsport gdx=trnsport lo=%GAMS.lo%

* Write the header to a CSV file
$echo '"canning plants","markets","shipment quantities in cases"' > quotedHeader.csv

* Append the data to the already existing file. One must prevent GDXDump to
* add the default header by enabling the option noHeader.
$call gdxdump trnsport.gdx symb=x format=csv noHeader >> quotedHeader.csv
$ifE errorLevel<>0 $abort Error writing to quoteHeader.csv using GDXDump!