Gdxxrw

Top  Previous  Next

Gdxxrw is a GAMS Corporation developed utility to read and write Excel spreadsheet data using GDX files.  In turn the associated GDX files can be read or written by GAMS as discussed in the Using GAMS Data Exchange or GDX Files chapter.

Gdxxrw is designed to be called from a DOS prompt.  It can also be invoked using the GAMS $Call or Execute commands as discussed above.  There are a lot of options involved with Gdxxrw that are described in the document GDX facilities in GAMS at gdxutils.pdf.  Here I just give a broad treatment of the most important.

Starting with Excel 2007, Microsoft introduced additional file extensions for Excel spreadsheets. The new .xlsx and .xlsm formats allows for more rows and columns in the spreadsheet data. When using Excel 2007 or a later version,  GDXXRW will write an Excel files as a .xlsx file unless a different file extension is specified for the output file.

Gdxxrw uses command line arguments.  The basic calling sequence is

 

Gdxxrw Inputfile Output=filename options

 

where

Inputfilemust have an extension and tells the name of a file to read from or write to.  The read from a spreadsheet occurs if the extension is a workbook extension (.xls, .xlsx, .xlsm, .wk1, .wk2, .wk3 and .dbf).  The write to the spreadsheet occurs if the file has a GDX extension.  This can also be entered as I=inputfile.
Output=filenameis an optional specification of the name of target workbook or GDX file where the output is to be written.  If not present the file name will be the input file name with a workbook (.XLS or .XLSX) or GDX extension and no path.  A shortcut entry occurs with O=filename.
Optionsare a number of possible options as discussed below.

Notes:

If no path is specified for the input or output files the file is assumed in the current or project file directory.
One needs to use quotes for file names and paths with spaces in them as discussed above.
Command line parameters can be read from a file or a spreadsheet as discussed below.