Creating a schema.ini file for text files
To use a fixed-width text file or a comma-delimited text file that contains mixed data types in the same column as a data source, you need to create a schema.ini file to identify the contents of the file.
The schema file includes entries that specify characteristics of the text file including the filename, file format, field names, widths, and types, character set, and data type conversions. You can use any text editor to create the schema file, which must be stored in the same directory as the text file.
The following example shows the information that must be included in the schema file for a fixed-width text file.
[filename.txt]
Format=FixedLength
ColNameHeader=False
Col1=ColName1 TEXT Width 15
Col2=ColName2 TEXT Width 15
Col3=ColName3 TEXT Width 40
Col4=ColName4 TEXT Width 20
CharacterSet=ANSI
The following example shows the information that must be included in the schema file for a comma-delimited text file that contains mixed data types.
[filename.txt]
Format=CSVDelimited
ColNameHeader=False
Col1=ColName1 TEXT
Col2=ColName2 TEXT
CharacterSet=ANSI
Item | Description |
---|---|
Filename | Text file name; must be enclosed in brackets |
Format | Text file format: FixedLength or CSVDelimited |
ColNameHeader | Indicates if the first record in the text file contains column headings (true) or not (false) |
Col | Column by number; required for fixed-width files but optional for comma-delimited files |
ColName | Column name; used to identify the column in QA Wizard Pro |
DataType | Type of data in the column:
|
Width | Column width |
CharacterSet | Character set: ANSI or OEM |