A flat file is an ASCII text file which is saved with extension .txt, .csv etc…
There are two types of flat files
Delimited Flat Files
Fixed width flat files
Each column is separated by sum specifically characters such as comma, tab, space, semicolon, etc…
Example
Customer. Txt
CNo | CName | Amount |
7001 | PRASAD | 5000 |
7002 | SRINU | 7000 |
7003 | NANI | 9000 |
A record of fixed length needs tobe specified into multiple columns using break points
Ex: emp.txt
Note:
A delimiter flat file can also be known as variable length files.
Informatica Tutorials & Interview Questions
Step1:
Creation of source definition:
From tools menu select source analyzer from source menu
Click on import from file
Select the location of flat file(c:/ flat file)
Select the files of type all files
Select the file customer.txt click ok
Select the flat file type delimited
Select import fields name from first line
Click on next, click on next, click on next, click on finish
Step 2:
Create the target definition with the name T- customer (oracle)
Create a mapping with the name M _ delimited – flat file
Drop the source and target definition
From source qualifier connect the ports to target
Step4:
Create a session with the name S_ M_ delimiter _ flat file
Double click the session select the mapping tab
From left pane select SQ- customer
In a properties section set the following attributes
Attribute | Value |
Source file type | Direct |
File directory | C: Flat file |
File Name | Customer.xt |
From left pane select the target set the customer connect with the low type normal
Click apply and click ok
If you want to enrich your career and become a professional in Informatica, then visit Tekslate - a global online training platform: "Informatica Training" This course will help you to achieve excellence in this domain.
A file list is a collection of the files with same type and meta data, needs to be merged using source file type indirect
Open the notepad provide the path of each source file as given below
List.txt
C: /FLAT FILE/Customer .txt
C:/FLAT FILE/Customer info.txt
C:/FLAT FILE/Customer1. txt
Create source and target definitions
Create a mapping with the name M _ file list
Drop the source and target definition
From source qualifier connect the ports to target
Create a session with the name S_ M_ file list
Double click the session select the mapping tab
From left pane select SQ- customer
In a property section set the following attributes
Attribute | Value |
Source file type | Indirect |
Source file directory | C:/ Batch 4 pm |
Source file name | List.txt |
From left pane select the target set the writer connection with the target low type normal
Click apply, click ok
Reading the date from fixed-width flat files(variable length):
EMP.txt
7369 VENKAT RAVI KUMAR 450010
7499 SRINU (10 space)650020
From tools, menu select source analyzer
From the source, menu click on import from file
Browse to the location of the flat file select the file click ok
Select the flat file type fixed width click on next
Click at the desired location to create the break point
Click on next, provide the column information for each field
Click on finish
Double click the source definition click on advanced
Set no of bytes to skip between the records 2
Click ok
For indepth understanding of Informatica click on
Data Mart and Types of Data Marts
Informatica Tutorials & Interview Questions
Informatica Components Overview
Informatica Power Center 8.6 Installation
Our course design of tutorials is practical and informative. At TekSlate, we offer resources to help you learn various IT courses. We avail both written material and demo video tutorials. For in-depth knowledge and practical experience explore Online Informatica Training.
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.