2.7.36 impFileSel

Brief Information

Store the file structure before import in a Labtalk tree variable.

Additional Information

Minimum Origin Version Required:9.0 SR0

X-Function not designed for Auto GetN Dialog.

Command Line Usage

1. impFileSel xfname:=imppClamp fname:=str1$ trFiles:=tt;/

2. impFileSel xfname:=impMDF trFiles:=tr options:=trOpt;

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input xfname

Input

string

<unassigned>
The name of the X-function for import.
fname

Input

string

fname$
Specify the name of the file to get its file structure.
trfiles

Output

TreeNode

filestree
Store the file structure information of the previously defined file after import.
options

Input

TreeNode

<unassigned>
Only available for impMDF x-function, that to specify whether to choose the option of "import with data group".

Description

This x-function is used to store file structure before import, the structure will be stored in a tree variable, and it is possible to modify the tree structure to specify whether to import a certain selection of data later.

Examples

EX1

This example stores the file structure of the file whose name is stored previously in "fname$" in tree variable tt.

string fname$=system.path.program$ + "Samples\Import and Export\United States Energy (1980-2013).xls";
impFileSel xfname:=impMSExcel fname:=fname$ trfiles:=tt;
@tnd=2; //show both tag name and label of LT tree
tt.=;
// result:
// file1(United States Energy (1980-2013).xls)
//  +---Info(Info) = File Size: 31.50 KB
//  \---DataSheets(File Sheet(s))
//       +---DataSheet1(Oil) = 1
//       +---DataSheet2(Natural Gas) = 1
//       +---DataSheet3(Coal) = 1
//       \---DataSheet4(Total Primary Energy) = 1


EX2

This example shows how to use this X-function to get the channel structure after impMDF when import with data group:

Tree trOpt;
//Select to "Import with data group"
trOpt.selectionMode=1;
//Get the channel structure
impFileSel xfname:=impMDF trFiles:=tr options:=trOpt;

And you can refer to another example for specify channel names when import.

Related X-Functions

imppClamp, impMDF, impMatlab, impNITDM, impNIDIAdem, impPrism