<textPr> (Text Import Settings)

This element contains all of the text import settings.

Here's an example of the XML for a text connection:

example:
<connection id="1" name="text data" type="6" refreshedVersion="3" background="1"
  saveData="1">
  <textPr prompt="0" codePage="437" sourceFile="C:\Desktop\text data.txt" 
    delimiter="|">
    <textFields count="5">
      <textField/>
      <textField type="text" position="7"/>
      <textField type="text" position="28"/>
      <textField position="36"/>
      <textField type="text" position="41"/>
    </textFields>
  </textPr>
</connection>

Parent Elements

<connection>3.13.1)

Child Elements

Subclause

<textFields> (Fields)

§3.13.11

Attributes

Description

<codePage> (Code Page)

Code page associated with the text file.

1256: Arabic (Windows)

775: Baltic (DOS)

28594: Baltic (ISO)

1257: Baltic (Windows)

852: Central European (DOS)

28592: Central European (ISO)

10029: Central European (Mac)

1250: Central European (Windows)

936: Chinese Simplified (GB2312)

950: Chinese Traditional (Big5)

10082: Croatian (Mac)

866: Cyrillic (DOS)

28595: Cyrillic (ISO)

20866: Cyrillic (KOI8-R)

21866: Cyrillic (KOI8-U)

10007: Cyrillic (Mac)

1251: Cyrillic (Windows)

28603: Estonian (ISO)

863: French Canadian (DOC)

737: Greek (DOS)

28597: Greek (ISO)

10006: Greek (Mac)

1253: Greek (Windows)

869: Greek, Modern (DOS)

1255: Hebrew (Windows)

861: Icelandic (DOS)

10079: Icelandic (Mac)

932: Japanese (Shift-JIS)

949: Korean

1361: Korean (Johab)

28605: Latin 9 (ISO)

865: Nordic (DOS)

855: OEM Cyrillic

437: OEM United States

860: Portuguese (DOS)

10010: Romanian (Mac)

20261: T.61

874: Thai (Windows)

857: Turkish (DOS)

28599: Turkish (ISO)

10081: Turkish (Mac)

1254: Turkish (Windows)

10017: Ukrainian (Mac)

65000: Unicode (UTF-7)

65001: Unicode (UTF-8)

20127: US-ASCII

1258: Vietnamese (Windows)

850: Western European (DOS)

28591: Western European (ISO)

10000: Western European (Mac)

1252: Western European (Windows)

The possible values for this attribute are defined by the XML Schema unsignedInt datatype.

<comma> (Comma is Delimiter)

Flag indicating whether to treat comma characters as field delimiters.

The possible values for this attribute are defined by the XML Schema boolean datatype.

<consecutive> (Consecutive Delimiters)

Flag indicating whether consecutive delimiters should be treated as just one delimiter. If this flag is true than it's possible or even likely that some rows will return more fields than others, and these fields will always fill cells in the worksheet from left to right.

The possible values for this attribute are defined by the XML Schema boolean datatype.

<decimal> (Decimal Separator)

The decimal separator character. This and the @thousands attribute are used only when data in the text file contains decimal and thousands separators that are different from those used on the computer, due to a different language setting being used.

The following table shows the results when you import text into a spreadsheet application using various separators. Numeric results are displayed in the rightmost column.

System decimal separator

System thousands separator

Text file decimal separator value

Text file thousands Separator value

Text imported

Cell value (data type)

Period

Comma

Comma

Period

123.123,45

123,123.45 (numeric)

Period

Comma

Comma

Comma

123.123,45

123.123,45 (text)

Comma

Period

Comma

Period

123,123.45

123,123.45 (numeric)

Period

Comma

Period

Comma

123 123.45

123 123.45 (text)

Period

Comma

Period

Space

123 123.45

123,123.45 (numeric)

Strings values of this attribute are expected to be one character in length.

The possible values for this attribute are defined by the ST_Xstring simple type (§3.18.96).

<delimited> (Delimited File)

true if the file is Tab or character delimited. false if the file should be parsed according to fixed length fields.

The possible values for this attribute are defined by the XML Schema boolean datatype.

<delimiter> (Custom Delimiter)

User-specified character to be treated as a field delimiter. Only single characters are supported.

The possible values for this attribute are defined by the ST_Xstring simple type (§3.18.96).

<fileType> (File Type)

Ignorable attribute with enum value that equals either "Macintosh," "Windows (ANSI)," or "MS-DOS (PC-8)" (see the definition of ST_FileType) and determines the kind of character set to use during import.

Only one of @fileType and @codePage should be specified for a <textPr>.

The possible values for this attribute are defined by the ST_FileType simple type (§3.18.30).

<firstRow> (First Row)

Indicates at what row of the file to start the data import. All unsignedInt values are valid, although it's possible that firstRow will be higher than the number of rows in the text file, in which case no data will be imported.

The possible values for this attribute are defined by the XML Schema unsignedInt datatype.

<prompt> (Prompt for File Name)

Flag indicating whether the user wants to be prompted for the file name on refresh. If false, then the user is not prompted. If true or not present, then the user is prompted.

The possible values for this attribute are defined by the XML Schema boolean datatype.

<qualifier> (Qualifier)

Character used as the text string qualifier.

The possible values for this attribute are defined by the ST_Qualifier simple type (§3.18.63).

<semicolon> (Semicolon is Delimiter)

Flag indicating whether to treat semicolon characters as field delimiters.

The possible values for this attribute are defined by the XML Schema boolean datatype.

<sourceFile> (Source File Name)

Path to the text file to use to import external data. May be expressed in URI or system-specific file path notation.

Note:

The possible values for this attribute are defined by the ST_Xstring simple type (§3.18.96).

<space> (Space is Delimiter)

Flag indicating whether to treat space characters as field delimiters.

The possible values for this attribute are defined by the XML Schema boolean datatype.

<tab> (Tab as Delimiter)

Flag indicating whether to treat tab characters as field delimiters. If false, then tabs will not be used as delimiters. If true or not present, then they will be used as delimiters.

The possible values for this attribute are defined by the XML Schema boolean datatype.

<thousands> (Thousands Separator)

The thousands separator character. This and the @decimal attribute are used only when data in the text file contains decimal and thousands separators that are different from those used on the computer, due to a different language setting being used. Please refer to the @decimal attribute description above for a Table describing the behavior.

Strings values of this attribute are expected to be one character in length.

The possible values for this attribute are defined by the ST_Xstring simple type (§3.18.96).

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_TextPr">
	<sequence>
	<element name="textFields" minOccurs="0" maxOccurs="1" type="CT_TextFields"/>
	</sequence>
	<attribute name="prompt" use="optional" type="xsd:boolean" default="true"/>
	<attribute name="fileType" use="optional" type="ST_FileType" default="win"/>
	<attribute name="codePage" use="optional" type="xsd:unsignedInt" default="1252"/>
	<attribute name="firstRow" use="optional" type="xsd:unsignedInt" default="1"/>
	<attribute name="sourceFile" use="optional" type="ST_Xstring" default=""/>
	<attribute name="delimited" use="optional" type="xsd:boolean" default="true"/>
	<attribute name="decimal" use="optional" type="ST_Xstring" default="."/>
	<attribute name="thousands" use="optional" type="ST_Xstring" default=","/>
	<attribute name="tab" use="optional" type="xsd:boolean" default="true"/>
	<attribute name="space" use="optional" type="xsd:boolean" default="false"/>
	<attribute name="comma" use="optional" type="xsd:boolean" default="false"/>
	<attribute name="semicolon" use="optional" type="xsd:boolean" default="false"/>
	<attribute name="consecutive" use="optional" type="xsd:boolean" default="false"/>
	<attribute name="qualifier" use="optional" type="ST_Qualifier" default="doubleQuote"/>
	<attribute name="delimiter" use="optional" type="ST_Xstring"/>
</complexType>