3.7.5.106 Wks.Export

LabTalk Object Type:

Window Object

The export object is a sub-object of the wks object.

Please see the expAsc X-Function.

Properties:

The export object is accessed using the following syntax:

[winName!]wks.export.property =

WinName! is optional. If winName! is not specified, the active worksheet is affected.

Property Access Description
wks.export.c1 Read/write
numeric

First column in the data range to be included with the data file. Set to 1, 2, ... n. To include all data, set to 1 (default).

wks.export.c2 Read/write
numeric

Last column in the data range to be included with the data file. Set to 2, 3, ... n. To include all data, set to 0 (default).

wks.export.cntrl Read/write
numeric

Include or exclude column names and labels with the data file and export a range of data. The value of this property controls export of Column Names, All Data, and Column Labels as follows:

Bit Values* Column Names All Data Column Labels
1 YES NO NO
2 NO YES NO
4 NO NO YES
8 export selected data

Note that bit values are additive. For example, to export Column Names + All Data + Column Labels, set the value to 1 + 2 + 4 = 7.

wks.export.r1 Read/write
numeric

First row in the data range to be included with the data file. Set to 1, 2, ... n. To include all data, set to 1 (default).

wks.export.r2 Read/write
numeric

Last row in the data range to be included with the data file. Set to 2, 3, ... n. To include all data, set to 0 (default).

wks.export.separator$ Read/write
numeric

Specify the separator for use in the data file. The default separator is "\t". The syntax is as follows: wks.export.separator$ = "," for a comma separator.


  • The range selected by the C1, C2, R1, and R2 properties will be used as long as there is no selection or only a single cell selected in the worksheet. If any other selection is active in the worksheet, that selection will be used.
  • If exported, column names are copied to the first line of the data file with the designated separator, followed by <CR>, then the labels (if exported), then the data.

Examples:

This script specifies the column range, row range, and separator for data export. It also specifies that the column names be exported with the file.

<pre> wks.export.c1 = 2;
wks.export.c2 = 4;
wks.export.r1 = 2;
wks.export.r2 = 12;
wks.export.cntrl = 1;
wks.export.separator$ = ",";
getfile *.dat;   // get a file name to use
save -wh %H %A;   // export the active window (must be wks)
</pre>