Text Data .TXT Import Automation Options

 

When the program is driven from an automation script, an options string can be specified in the script that acts as the import options dialogs do in the program. The string consists of comma-separated parameters, which specify the behavior of the various import options.

 

Parameter

Type

Description

Filter

string

TXT

ColumnBreaks

Comma separated Integers

Set of integers telling Voxler where the column breaks are. These integers will be separated by commas. Only use if UseFixedWidth = 1.

Example: ColumnBreaks=9,18,27

DateOrder

0 = Auto

1 = MDY

2 = DMY

3 = YMD

4 = MYD

5 = DYM

6 = YDM

Integer that specifies the order in which dates are written in the data file. When set to 0, the standard date order from the Locale is used.

DecimalSymbol

period = period

comma = comma

String that specifies the character that separates the integer and fractional components of the data values.

Delimiter

string

String which tells Voxler which delimiter to use to separate each column. Voxler recognises space, tab, comma, semicolon as strings, otherwise use the literal string. Only use if UseFixedWidth = 0.

Example:

Delimiter=(

Delimiter=comma

EatWhiteSpace

1 or 0

0 does not skip extra spaces between values. 1 skips extra spaces and tabs between values.

ImportCodePage

Integer

The number of the ANSI code page to use when importing Unicode data. Valid code page number in the range 0 through 65535.

Locale

String

Locale ID in decimal values. The default locale is determined by the locale setting in the Windows Control Panel.

SkipExtraDelimiters

1 or 0

0 skips extra delimiters. Multiple delimiters are treated as a single delimiter. 1 makes each delimiter a separate delimiter.

StartRow

Integer

The row to start importing from. Everything before this row will be discarded.

TextQualifier

string

Tells Voxler what quote characters to use. Options are singlequote, doublequote, or none.

UseFixedWidth

1 or 0

1 uses a fixed width column. 0 uses a delimited column.

 

Example

This example shows how to import a TXT file with the various options.

 

CommandApi.Construct("Import")

  CommandApi.Option("GuiEnabled", "False")

  CommandApi.Option("ProgressEnabled", "False")

  CommandApi.Option("UndoRedoEnabled", "True")

  CommandApi.Option("AutoConnect", "False")

  CommandApi.Option("ClearOptions", "False")

  CommandApi.Option("Filter", "txt")

  CommandApi.Option("Path", "C:/Path/To/Import/file.txt")

  CommandApi.Option("PersistOptions", "True")

CommandApi.Do()

 

Used by: Import

 

 

See Also

Automation Model