Batch mode

Top  Previous  Next

Xls2gms can operate in batch mode.  The basic call is of the form

 

XLS2gms i=inputsheet o=outputinclude r=range

 

from a DOS prompt or

 

$call =XLS2gms i=inputsheet o=outputinclude r=range

 

from within GAMS.

In these cases

The = is needed to make GAMS wait as discussed above.
Inputsheet is the name of the .xls spreadsheet file.
Outputinclude is the name of the file where the include file is to be saved.
One needs to use quotes for file names and paths with spaces in them as discussed above.
Range identifies the portion of the sheet to import.
If range is not specified Xls2gms uses the entire contents of the first sheet in the workbook.
If no sheet name is specified (i.e. r=a1:b3) then one gets the given range from the first sheet in the workbook.
If no range is specified but a sheet is (i.e. r=sheet1!) then one gets the whole sheet.
Range names are allowed (i.e. r=myrangename).
Several other parameters may be used
@filename identifies a file from which to read command line options where within that file each line contains only one option, typed just as if it were specified on the command line.
B causes fields with blanks to be quoted as discussed above.
S= specifies a field separator (i.e. s=, yields CSV files) as discussed above.
M turns on mute mode as discussed above.
L inserts $offlisting and $onlisting as discussed above.
P converts numbers to decimal point format as discussed above.