Import a fixed-width flat file into the folder that you created in the Repository Manager. When you import a fixed-width file, you can create, move, or delete column breaks.
In the Designer, connect to the repository and open the folder that you created in the Repository Manager.
To import a flat file source definition, open the Source Analyzer and 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
Fixed Width
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.
The following image shows the wizard in which you can configure the fixed-width flat file properties:
Click
Next.
To set the width of the columns, drag the existing column breaks. Follow the directions in the wizard to manipulate the column breaks in the file preview window.
The following image shows the wizard in which you can set the width of the columns:
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.
The following image shows the column details that you can configure:
Click
Finish.
The flat file appears on the Source Analyzer window.
The following image shows the fixed-width flat file that you imported in the task: