In this example,
you will create a new file format euro_conversion.fileformat to
store the definition of a file for future use. While creating a new
file format, you will identify the type of the flat file (delimited, fixed-length, or PC/IXF), define
the column names, data types, the delimiter characters and so
on. You will save the file format inside your data warehousing project
and then load the format in the file source operator to import data
from the same kind of file.
ProcedureTo
create the file format:
- From the File menu,
select . The New File window opens.
- In
the File format name field, type euro_conversion.fileformat and
click Finish.
- Specify
the file format properties as follows:
- In
the File type list, select Delimited
Format.
- In the Field
delimiter list,
select ,.
- In the String
delimiter list,
select ".
- In the Date
format list, select MM/DD/YYYY.
- In the Timestamp format list,
leave the default selection as DEFAULT.
- Leave the code page and null character properties
to
the default value.
- In
the Field list table, click
to add a new column
definition. - In the Column
Name field, type COUNTRY_CODE.
- In the Data type list,
select INTEGER.
- Leave
the length and scale fields blank.
Repeat
step 3 to add four more columns in the field list:
COUNTRY_CODE, EURO_YEAR, EURO_MONTH, and, EURO_TO_LOCAL, . The field
definition should appear as shown in the figure below.
- Save the file format. The file
format is stored inside
the file-formats directory of your data warehousing project.
- To use this file format in a file source operator,
open
the Properties view of the file source operator, click the File
Format tab and then click Load from File Format.
This approach saves a lot of design time for data flows that import
data from the same kind of file.