Suppose we have a csv file with contents as below which is
used has a source file.

C1,C2,C3,C4
100,200,A B,300
200,400,X,Y,299 ---> it should be 4 values but by mistake
300,600,C D,566 with a comma in between X & Y,its 5.

My target takes only 4 columns, How to take care of the 2
record as above without rejecting it and loading in the target.

Hope u guys have understood my scenerio

Answers were Sorted based on User's Feedback



Suppose we have a csv file with contents as below which is used has a source file. C1,C2,C3,C4 ..

Answer / abhinav

I am not sure if the solution I am going to post will
actually work but it is worth a shot:

1. Don't define a delimiter so that the records are read
as '100,200,A B,300' and '200,400,X,Y,299' and so on i.e.
as a single record. This is to ensure that all the records
pass the source-qualifier.

2. Now you have all the records including the faulty one in
SQ. Next, you put an expression where you use REPLACECHAR
to remove all the commas from all the records. Now ALL your
records will of the same length.

3. Next you can use SUBSTR to read the first 3 numbers to
get the first column, next 3 to get the second column and
so on and so forth to get proper data in proper columns.

My explanation might not be clear but I have a hunch that
this might work.

Is This Answer Correct ?    5 Yes 4 No

Suppose we have a csv file with contents as below which is used has a source file. C1,C2,C3,C4 ..

Answer / dj

ou can do this by executing a pre session unix command. Replace consecutive delimiters with some Junk value and later in informatica mapping replace it with null.

Is This Answer Correct ?    0 Yes 0 No

Suppose we have a csv file with contents as below which is used has a source file. C1,C2,C3,C4 ..

Answer / shirishworld2000

Waiting for the response

Is This Answer Correct ?    0 Yes 1 No

Suppose we have a csv file with contents as below which is used has a source file. C1,C2,C3,C4 ..

Answer / naveen

By using replace char function we can write this


Suppose

length(replacechr(c3,'1234567890abcdefghtijklmnopqrstuvwzyz',null))

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Informatica Interview Questions

A Main workflow "wkf_Main" has multiple sessions (S1, S2...., can I make changes and promte one session (S5) at any time or have to promote whole Workflow "wkf_Main" every time?

4 Answers  


How i can Schdule the Informatica job in "Unix Corn Schduling tool" ?

2 Answers  


How do you load only null records into target? Explain through mapping flow.

0 Answers  


Give some information on report bursting and how to do it in bca as I have to split the report and send different reports to different people?

0 Answers  


i have one table like cust_id ph1 ph2 ph3 1002 9290123526 97671927210 9876545232 we use Normalizer wt is o/p? sue normalizer we can generate three tables in single table/

4 Answers  






I have the source like col1 col2 a l b p a m a n b q x y How to get the target data like below col1 col2 a l,m,n b p,q x y

2 Answers   DELL,


how many ways can we implement SCD2?

4 Answers   IBM, TCS,


Q. WE ARE LOADING ORACLE TABLE THE PROCESS RUNS THREE HOURS. THIS TABLE IS BEING USED BY SOME DOWNSTREAM TEAMS SO WHAT WE WANT IS IN BETWEEN RUN IS PROGRESS IF ANYONE IS FETCHING THE DATA FROM THE TABLE THEY SHOULD SEE DATA TILL YESTERDAY TILL THAT. AFTER THAT PROCESS IS COMPLETED ONLY THEN TEAM SHULD BE AVAIBLE TO SEE TODAY DATA UPDATED. WE DONOT WANT TO LOG THE TABLE. NEED APROACH FROM YOUR SIDE.

0 Answers  


Tell me about MD5 functions in informatica

0 Answers  


what is procedure to use mapping variable in source qualifier transformation? with example

1 Answers   IBM,


What are your source in project and how you import in informatica? How can i explain abt this?

1 Answers   Accenture, Unisoft Infotech,


Explain about Recovering sessions?

1 Answers  


Categories