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 |
DAT |
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 1
This example shows how to import a DAT file with the various options in a single option string.
CommandApi.Construct("Import")
CommandApi.Option("GuiEnabled", "False")
CommandApi.Option("ProgressEnabled", "False")
CommandApi.Option("UndoRedoEnabled", "True")
CommandApi.Option("AutoConnect", "True")
CommandApi.Option("ClearOptions", "False")
CommandApi.Option("Filter", "dat")
CommandApi.Option("Options", "AggressiveConversion=0; Delimiter=space,tab,comma,semicolon; EatWhitespace=1; SkipExtraDelimiters=0; StartRow=0; TextQualifier=doublequote,quote; UseFixedWidth=0")
CommandApi.Option("Path", "C:/Path/To/Import/file.dat")
CommandApi.Option("PersistOptions", "True")
CommandApi.Do()
Example 2
This example shows how to import a DAT file with the various options on multiple option strings.
CommandApi.Construct("Import")
CommandApi.Option("GuiEnabled", "False")
CommandApi.Option("ProgressEnabled", "False")
CommandApi.Option("UndoRedoEnabled", "True")
CommandApi.Option("AutoConnect", "True")
CommandApi.Option("ClearOptions", "False")
CommandApi.Option("Filter", "dat")
CommandApi.Option("Options", "AggressiveConversion=0")
CommandApi.Option("Options", "Delimiter=space,tab,comma,semicolon")
CommandApi.Option("Options", "EatWhitespace=1")
CommandApi.Option("Options", "SkipExtraDelimiters=0")
CommandApi.Option("Options", "StartRow=0")
CommandApi.Option("Options", "TextQualifier=doublequote,quote")
CommandApi.Option("Options", "UseFixedWidth=0")
CommandApi.Option("Path", "C:/Path/To/Import/file.dat")
CommandApi.Option("PersistOptions", "True")
CommandApi.Do()
Used by: Import
See Also