Import a delimited flat file into the folder that you created in the Repository Manager. You can specify delimiters, optional quotes, and escape characters that are contained in the source file code page.
In the Designer, connect to the repository and open the folder that you created in the Repository Manager.
Open the Source Analyzer, click
Sources
Import from File
.
The
Open Flat File
dialog box appears.
Select the flat file that you want to use.
Select a code page.
When you import a flat file source definition, select a code page that matches the code page of the data in the file.
Click
OK.
The Flat File Import Wizard opens and the contents of the file appear at the bottom of the wizard.
In the wizard, select the
Delimited
file type.
Enter a name for the source. Default is the name of the flat file.
Enter the row number at which the wizard starts reading when it imports the file. Default is 1.
If the first row contains the column names, select
Import field names from first line
. When you select this option the Start Import at Row field value changes to 2.
Click
Next
.
Any incorrectly parsed fields display in red text in the file preview window at the bottom of this screen.
To separate columns of data, select the delimiter present in the flat file that you imported.
You can use the Other field to enter a different delimiter.
If you want the wizard to read one or more consecutive column delimiters as one, select
Treat consecutive delimiters as one
. If you want the wizard to read a specified set of delimiters as one, select
Treat multiple delimiters as AND
.
If you want to escape a delimiter, specify an escape character.
When you specify an escape character, the PowerCenter Integration Service reads the delimiter character as a regular character.
In the Text Qualifier field, choose No Quote, Single Quote, or Double Quotes.
If you select a quote character, the Flat File Wizard ignores delimiters within pairs of quotes.
The following image shows the delimiters that you can configure for a delimited flat file:
Click
Next
.
Enter the following column information for each column in the file:
Name. Default is the column name in the file. Optionally, you can enter another column name.
Datatype. Select Text, Numeric, or Datetime. Based on the data type, enter the appropriate length, precision, scale, and width. Or you can use the default values that the wizard contains.
To switch between columns, select a column in the
Source Definition
, or click the column heading in the file preview window.