top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Informatica: How to get MIDDLE Data from a FILE?

0 votes
1,468 views

I have 20 records in a file and I don't need the first and the last line, I need data from 2 through 19 lines only.
How can I achieve this?

posted Jun 17, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Step 1: You have to assign row numbers to each record. Generate the row numbers using the expression transformation. Create a DUMMY output port in the same expression transformation and assign 1 to that port. So that, the DUMMY output port always return 1 for each row.

Step 2: Pass the output of expression transformation to aggregator and do not specify any group by condition. Create an output port O_total_records in the aggregator and assign O_count port to it. The aggregator will return the last row by default. The output of aggregator contains the DUMMY port which has value 1 and O_total_records port which has the value of total number of records in the source.

Step 3: Pass the output of expression transformation, aggregator transformation to joiner transformation and join on the DUMMY port. In the joiner transformation check the property sorted input, then only you can connect both expression and aggregator to joiner transformation.

Step 4: In the last step use router transformation. In the router transformation create two output groups.
In the first group, the condition should be O_count = 1 and connect the corresponding output group to table A. In the second group, the condition should be O_count = O_total_records and connect the corresponding output group to table B. The output of default group should be connected to table C, which will contain all records except first & last.

answer Jun 18, 2014 by Shatark Bajpai
Similar Questions
+1 vote

I have a Comp3 file as a source in my mapping. How do I load data in the target. The source defination has fixed length and the Code Page is '7-bit ASCII'. The data is not populated properly. Please help.

+1 vote

Please help me to read data from a password protected excel file with informatica

Basically i need to convert excel to csv and read with informatica

Thanks

0 votes

Design a mapping to load the first record from a flat file into one table A, the last record from a flat file into table B and the remaining records into table C?

0 votes

I want to copy the data into one excel file, while the mapping has been running in informatica.

...