Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Say I want to replace all values in a column with a value of specific length in that column.
For this input column I only want my output to have "ABCDEFGHIJKL" for one column. How do I do this?
Hi, in the tMap you made no link between the input and output column you want with a fixed value and in the output field you add the value you want. ex "ABCDEFGHIJKL" and all the values of this column will be "ABCDEFGHIJKL".
send me love and kudos
Thanks but What if the value is not fixed since the job im making iterates through different files?
does the lengh is fixed and is the condition to find the value ?
yes the length is fixed. Attached are the input and output table
"ABCDEFGHIJKL" is a sample SEIN
are you able to read data with talend and if yes could you send the content of the talend input?
you can read the file a first time :
set a global var in a tjavarow :
if(input_row.(yourfield)!=null && StringHandling.LEN
(input_row.(yourfield))==(your lengh value)
globalMap.put("SEIN",input_row.(yourfield));
then your read it again and in the tmap output you can set the value with (String)globalMap.get("SEIN")
Here it is and tmap table. Thanks!
so do the same you have in tmap but just put the SEIN column in output and add a filter condition on output ("SEIN").equals(row2.A)
and in SEIN column value row2.B.
then you add a tSetGlobalVar after the tmap with a main link (with key "SEIN" and value out.SEIN)
then you read again your file and you can use globalMap.get("SEIN") to set the value to all the values of the column