上QQ阅读APP看书,第一时间看更新
Working with delimited files
Following are the steps that you will have to perform to work with delimited files:
- In the Designer, go to Tools | Source Analyzer to open the Source Analyzer.
- Go to Sources | Import from File....
- Browse the files you wish to import as source files.
The Flat file import wizard will come up on the screen. The File import wizard screen will help you specify the properties for importing the file in a proper format.
- Complete the following steps:
-
- Select the file type as Delimited:
-
- If the file contains column names as headers in the first line, then we will need to start importing at row 2 as this option indicates from which row the actual data has to be imported. If the file doesn't contain the headers in the first line, we will import the data from the first line only.
- Files may contain the column names in the first line as headers. You need to verify the file properly before you start working on it. Import field names from the first line enable us to import the header names into the Source Definition. If you do not select this option, the header names will not be imported.
- Click on Next, as shown in the following screenshot:
- Select the type of delimiter used in the file. In our case, we are using the comma as the delimiter. You can select the delimiter as per the file you are using.
- Also check the quotes option--No Quotes, Single Quotes, and Double Quotes--to work with the quotes in the text values. This option enables us to import the data with single or double quotes in text values. We are using No quotes as our option since the sample file we are using does not have any data with quotes.
- Click on Next:
- Verify the columns name, data type, and precision in the data view option. You can edit the column names and other details in this view as shown in the following screenshot. Generally, you do not need to do so.
- Click on Finish to get the source imported in the Source Analyzer as shown in the following screenshot:
We now move on to the other Flat file type--the fixed width files.