Load 1 input column values (with delemeter) into different target columns

I have column X which having 3 values A;B;C. How can I load these values into 3 diff cols in the target. If tomorrow I will receive 100 values for same single column I will load into 100 target cols respectively (Same de-limiter) ?

Questions by Aloka   answers by Aloka

Showing Answers 1 - 5 of 5 Answers

vibgyss

  • Aug 24th, 2016
 


Make your job design as below
Seqfile-transformer-target
Read the data by using seqfile as single record. i.e.
File= give the file path
Go to Columns tab= mention REC VARCHAR 50 (WE ARE READING INPUT AS SINGLE RECORD)
Transformer:
Create the output links as many as you want
For 1st output link write the derivation like below
Field(inputlink,’;’,1)
For other output link replace 1 as 2, 3, 4 and so on….
You will get the required output

  Was this answer useful?  Yes

LOKESH

  • Jan 25th, 2017
 

Using Filed function we can achieve the requirement.
Filed (Filed name,;,1) ---> A Column
Filed (Filed name,;,2) ---> B Column
Filed (Filed name,;,3) ---> C Column

  Was this answer useful?  Yes

rajkumar8k

  • Feb 17th, 2017
 

Thats a nice answer Lokesh. But in this approach everyday we have to modify the job after seeing the number of values in the input. So we must think of one generic job where it will read all the input values and generate the required columns in the output.

  Was this answer useful?  Yes

ABACHREK

  • Mar 3rd, 2017
 

Loop through the incoming field using looping functionality in transformer. Extract the individual values using field function and the iteration number. Output the individual values to the output link. Add a new column FileNo which will store the iteration number. The multiple output records will now be passed to a single output link. After the file is created split it into multiple files using unix command in After Job Sub routine.

  Was this answer useful?  Yes

Roopa

  • Mar 2nd, 2018
 

Using Field function. Field(column,delimeter,1) and so on

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions