SCA Utility Applet: XLSWRITE

Download the XLSWRITE installation (6/14/2001, 2.7MB)

The SCA applet, XLSWRITE, is used to write the contents (numeric and character information) of an existing text file into a specified location in an Excel spreadsheet. The text file can be the output from an applet program or saved results from an SCA System session. This utility works best when the contents of the text file that you wish to merge into an Excel spreadsheet are stored in fixed-column format. By adhering to fixed column-widths, the character and numeric information will be inserted into separate cells in the Excel spreadsheet.

The utility program will automatically determine the number of fixed-length columns by parsing the first row of data in the text file. As mentioned, the information that is read from the text file may be numeric or character. If the data in the text file is not in fixed column format, the text file will be "blasted" into the specified cell of the Excel spreadsheet so that the first row of data in the text file will be written to cell(1,1), the second row of data in the text file will be written to cell(2,1), etc.

  • XLSWRITE Applet syntax

     WRITE XLSFILE IS 'c'
           SHEET 'c'.
           STARTCELL IS 'RiCj'
           LABELS 'c1, c2, --'.
           TEXTFILE 'c'.
           FIXED-LENGTH IS 'i1, i2, --'.
           MISSING IS '*'.
    @
    @
    @
    @
    @
    @

    Required sentence: XLSFILE, TEXTFILE

    Legend: v -- variable name; i -- integer value;
    'c'-- character string; RiCj -- Row and Column;


    Sub-command Descriptions

    Note: All arguments must be specified in single or double quotes regardless of the argument type for this particular applet. All commands and sub-commands may not be truncated (i.e., the entire word must be specified).

    XLSFILE sub-command
       The XLSFILE sub-command is used to specify the name of the Excel
       spreadsheet that the information is to be written. You may specify the
       complete path to the file or simply the filename if it exists in the current
       directory. If the Excel file is not found, a new one will be created by the
       XLSWRITE utility.

    SHEET sub-command
       The SHEET sub-command is used to specify the name of the sheet in
       the Excel spreadsheet that the information is to be written. The default
       is 'SHEET1'. If a specified sheet does not exist in the spreadsheet,
       a new sheet will be created by the XLSWRITE utility.

    STARTCELL sub-command
       The STARTCELL sub-command is used to specify the position of the
       beginning cell in the Excel spreadsheet that the information is written.
       The default is 'r1c1'. The user must specify the location of the starting
       cell using the Row and Column format as shown in the default.

    LABELS sub-command
       The LABELS sub-command is used to specify column headings for the
       information written to the destination Excel spreadsheet. If the LABELS
       sub-command is specified, the column headers will be written to the
       beginning cell specified in the STARTCELL sub-command. The
       information read from the text file will then begin in the next row.

    TEXTFILE sub-command
       The TEXTFILE sub-command is used to specify the name of the text
       file that contains information to be written to the Excel spreadsheet.
       The contents of this file must be delimited by spaces or by tab characters.
       This assures that the information in the result file will be written to individual
       cells in the spreadsheet. Otherwise, the contents of the file will be "blasted"
       into the spreadsheet one row at a time.

    FIXED-LENGTH sub-command
       The FIXED-LENGTH sub-command is used to specify the character
       length of each column of data in the text file. If all variables have the same
       fixed length, e.g., 10 characters, the user may specify the single integer 10
       for all variables. The default is 12 characters.

    MISSING sub-command
       The MISSING sub-command is used to specify if the text file contains
       missing data codes. Any missing data code encountered by the XLSWRITE
       program will appropriately skip the associated cell in the Excel spreadsheet.
       The default is '*'.

    --EXAMPLES