• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Flat Files in Informatica

Flat Files in Informatica Introduction

A flat files is an ASCII text file which are saved with extension  .txt, .csv etc…

There are two types of flat files

Delimited Flat Files

Fixed width flat files

Delimited Flat Files

Each column is separated by sum specifically characters such as comma, tab, space, semicolon etc…

Example

Customer. Txt

CNoCNameAmount
7001PRASAD5000
7002SRINU7000
7003NANI9000

Fixed width Flat Files

      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.

Design a mapping to read the data from delimited flat files:

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)

Step3:

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

AttributeValue
Source file typeDirect
File directoryC: Flat file
File NameCustomer.xt

From left pane select the target set the customer connect with the low type normal

Click apply and click ok

Interested in mastering Informatica? Learn more about Informatica Tutorial in this blog post.

File list:

A file list is a collection of the files with same type and meta data, needs to be merged using source file type indirect

Creation of file list:

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

AttributeValue
Source file typeIndirect
Source file directoryC:/ Batch 4 pm
Source file nameList.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

Procedure:

From tools menu select source analyzer

From 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 oon 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

Variable Ports in Informatica

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.

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Flat Files in Informatica"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.