Using flat file (delimited file) as a source in Data Services
Here is an example of how to use a delimited flat file as a source in BODS.
- Login to BODS Designer.
- Create a test Project (TEST_PROJECT).
- Create a test Job (JOB_TEST_FLATFILE)
- Create a Dataflow and name as (DF_FLATFILE)
Now we need to create a File Format for which we will be using our input file as a source.
- Go to the Local Object Library and click on the Formats Tab.
- Right click the Flat files and click on NEW. The below screen appears.
- Make sure the file type you select is “Delimited” for the delimited file format.
- Give appropriate name for the File Format. Say Test_FF
- Root Directory – Select the location from where the input file needs to be picked up from.
- File Name – Under this we have to select the file which needs to be taken as an input
- Under delimiters, select the row delimiter (| in this example) and the column delimiter. (Mostly a new line)
- If your file contains header as the first line and if you do not want it to appear in the source, then select the option ‘Skip row header’ as ‘Yes’.
9. Now click on Save and close.
10. The file format will be created and this can be now used as an input for your job.
Using Multiple flat files (delimited) as source with single file format
We can also choose multiple files instead of single file by separating the file names with commas or placing wild card character at the end of the file name.
For example I have taken 2 input files Test1.txt and Test2.txt
Below are the inputs of these 2 files.
In the File Format Editor, the place where the File name is specified, place Test*.txt. This takes the input from 2 files (Test1.txt and Test2.txt). We can also provide the file names separated by commas.
The output of the job is combined with both input file Test1.txt and Test2.txt as shown below.