DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


Exporting to a text file

Command: File -> Save -> Text File...

An frequently-needed task is to create a text file which contains only selected variables of the data table. The command File/Save/Text File provides such an ability. The contents and the format of the file to be created can be configured interactively. The user may select any number of variables and can assign a specific data format to the column of each variable.
Hint: Text files created by this command cannot be re-imported to DataLab.

After selecting the command a window is displayed which serves to specify the contents and the format of the text file. This can be done either globally by clicking the commands of the sub-menu, or on an individual basis by clicking single variables in the variables-list box. The commands of the sub menu always affect the whole list of variables and comprise the following actions:

Cancel Quit the command.
Export Data Create a text file according to the set-up shown in the variables window. the text file contains a header information, and the identifiers of all objects of the data table along with all selected variables. The data are listed by one object per line.
Select None This command deselects all available variables.
Select All All variables are selected. This command can be used to select all but a few variables by first selecting all variables and then rejecting some of them.
Invert Selection Invert the selection of the variables. Selected variables become deselected and vice versa.
Field Width The field width of all variables can be set to a fixed value. Valid values are in the range of 4 to 32. The field width has to be a minimum of 10 if exponential notation is selected (see below).
Dec. Places This command sets the number of decimal places for all variables. Valid inputs are in the range of -2 to +18. A negative input indicates exponential notation. In this case the field width is automatically adjusted to a minimum of 10 characters. The number of places used for the exponent can be adjusted to either 2 (input '-2') or 4 (input '-1').

The format of the variables to be transferred to the text file can also be configured on an individual basis by using the list box at left. This window both shows the current set-up of the configuration and serves to change the set-up for each variable individually.

The variable window shows the selection state and the format for each variable. Selected variables are checked. The format of the variable is displayed in the form 'fw:dp' (field width, decimal places) along with each variable and can be changed by clicking the appropriate number - left clicking decreases the number, right clicking increases it.

In order to create a text file containing the selected variables, the user has to click the Do It button. A sample file is shown below. It has been created from a pesticide database, selecting five variables and various output formats.

Selected variables of file H:\PESTI\ARSALL.IDT

Created by DataLab: Dec-11, 1998 - 21:32:41

   Object name     lnKOC NRings  Cl NO2   RandicIx
   --------------------------------------------------
   ACEPHATE   |       0.693      0   0   0   4.538
   ALACHLOR   |       5.136      1   1   0   8.689
   ANCYMIDOL  |       4.787      3   0   0   9.247
   ASULAM     |       3.689      1   0   0   6.954
   ATRAZINE   |       5.537      1   1   0   6.613
   BENDIOCARB |       6.346      2   0   0   7.516
     .  .               .        .   .   .   .
     .  .               .        .   .   .   .
     .  .               .        .   .   .   .
   TERBUFOS   |       6.215      0   0   0   6.828
   TERBUTRYN  |       7.601      1   0   0   7.442
   THIRAM     |       6.507      0   0   0   5.447
   TRIALLATE  |       7.783      0   3   0   7.269
   TRIFORINE  |       5.298      1   6   0   10.108
   VERNOLATE  |       5.561      0   0   0   6.257

Hint: The variable names transferred to the text file are truncated at the field width of each variable. Thus, a small field width creates a compact file but may truncate the variable identifiers.