3.7.5.1 Ascimport

The Ascimport object contains properties and methods corresponding to the ASCII import Options dialog box.

Please see the impAsc X-Function.

Properties:

Property Access Description
Ascimport.ApplyRange Read/write
numeric

Apply new range to dataplots when file is imported. 1 = on, 0 = off.

Ascimport.AutoColTypes Read/write
numeric

Automatic determination of column types. 1 = on, 2 = off.

Ascimport.AutoSubHeaderLines Read/write
numeric

1 = Use autodetermination of subheaders. 0 = specify using Ascimport.SubHeaderLines.

Ascimport.Character$ Read/write
Character

The character to use when Ascimport.Delimeter = 4 (Other). One, printable ASCII character is allowed.

Ascimport.Delimited Read/write
numeric

Specify fixed width or delimited column separation. 0 = fixed width, 1 = delimited.

Ascimport.Delimiter Read/write
numeric

The delimiter to use for column separation. From the Origin list: 0 - Unknown
1 - Comma(,)
2 - Tab
3 - Space
4 - Other

Ascimport.FileName$ Read/write
string

The full path and name of the file to import.

Ascimport.HeaderLines Read/write
numeric

Number of lines to read as header.

Ascimport.Labels Read/write
numeric

Create column Labels from headers. 1 = on, 0= off.

Ascimport.LeadingZeroes Read/write
numeric

Support numbers with leading zeroes. 1 = on, 0 = off.

Ascimport.MaxLabels Read/write
numeric

Maximum lines to store in Column Labels.

Ascimport.NonNumeric Read/write
numeric

Action when non-numeric data is read for a numeric field: 0 - Terminate import
1 - Read as missing data
2 - Start new worksheet/column
3 - Append to header label

Ascimport.NumColumns Read/write
numeric

Specific number of columns to import. Deprecated - Use partial import instead.

Ascimport.Partial Read/write
numeric

Use Partial Import (1) or Full Import (0)

Ascimport.Partial.C1 Read/write
numeric

First column for partial import

Ascimport.Partial.C2 Read/write
numeric

Last column for partial import

Ascimport.Partial.R1 Read/write
numeric

First row for partial import

Ascimport.Partial.R2 Read/write
numeric

Last for partial import

Ascimport.RenameCols Read/write
numeric

Rename columns if first line has labels. 1 = on, 0 = off.

Ascimport.RenameWks Read/write
numeric

Rename Worksheet to Filename after import. 1 = on, 0 = off.

Ascimport.SubHeaderLines Read/write
numeric

Number of lines to read as SubHeader.

Ascimport.TestLines Read/write
numeric

Number of lines used for file structure testing.

Ascimport.Width$ Read/write
string

The string to use for Fixed Column Widths. For example: "6,19,19,19,2,20"

Methods:

Method Description
Ascimport.GetSettings()

Read the import settings from the active worksheet into the ascimport object. You can also specify the worksheet as in ascimport.getsettings(Data4).

Ascimport.Import()

Execute the ASCII import.

Ascimport.Reset()

Resets the partial range.

Ascimport.WriteSettings()

Write the ascimport object properties to the active worksheet. You can also specify the worksheet as in ascimport.writesettings(Data4).

Examples:

This example reads the current settings, specifies a range for partial import, sets the partial import flag, prompts the user for a filename, writes the settings and executes the import.

ascimport.GetSettings();
ascimport.Partial.C1=2;
ascimport.Partial.C2=5;
ascimport.Partial.R1=10;
ascimport.Partial.R2=14;
ascimport.partial=1;
getfile *.dat;
ascimport.WriteSettings();
ascimport.import();