Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Replace special characters on multiple columns

Hi Shong,
I have a situation,
i am having source table which contains lots of special characters in multiple columns.
i handled for single column using tReplace component but its very lengthy to take every column in tReplace which contains Special characters.
Is there any other way to handle multiple columns at a time for special characters.
This is the list of Special Characters that i have in my data and Replace_By value for every special characters
0683p000009M5Bh.png
Waiting for positive reply.
Thanks,
Shri_Kul1
Talend User
Labels (2)
21 Replies
Anonymous
Not applicable
Author

Hi
Take a look at tReplaceList component, this component allows you to replace special characters for multiple columns at a time. 
Anonymous
Not applicable
Author

Hi Shong,
Thanks for your reply, but i am not able to solve the issue using  tReplaceList   component , the values should replace with original are not replacing.
i think i am missing something over there. could you please help me out on the same?
This is my job design... and  the settings i applied in  tReplaceList  component.
i want to replace values of NAME column to values of NAME_A.

0683p000009MCr4.png  0683p000009MD1K.png
Anonymous
Not applicable
Author

Hi
The file you provided in your first post will be lookup table. In this case, the search column is SPL_CHAR, the replacement column is REPLAY_BY. 
Anonymous
Not applicable
Author

Hey Shong,
Thanks for your reply. I am trying same as you told , i took that file as lookup & the search column is SPL_CHAR & the replacement column is REPLACE_BY but there is problem that job giving error regarding null values in REPLACE_BY column.

0683p000009MD47.png
Actually i am having Null values in REPLACE_BY column so how could we handle this?
Kindly Suggest.
Anonymous
Not applicable
Author

Hi,
Before passing to tReplaceList , pass "replace by row" to tmap and replace null values by " ".  So you won't get null pointer exception.
Anonymous
Not applicable
Author

Hi Amol,
Could you plz elaborate the logic you are telling me to implement?
Anonymous
Not applicable
Author

Hi SK,
My logic is to avoid null pointer exception. In above post, "Replace by" Column in excel contains null value. So, I thought that may be that is reason.  In tmap ,use this expression row1.column==null?"":row1.column before mapping. so You can avoid null pointer exception
Anonymous
Not applicable
Author

Hi Amol,
Thanks for your reply, yes That column contains null values in Lookup file. but that lookup file need to connect to tReplaceList component not to tMap & that null values are coming from Lookup File.
0683p000009MD4C.png As per you suggestions i made job like this. But its not correct i guess.
correct me if am doing anything wrong.
Anonymous
Not applicable
Author

Hi SK,
I think, Metadata1 contains null value. Your job is correct. Only change is that Connect row3 to tReplaceList instead of tMap Becoz tReplaceList expects two input and you have connected only one input.
Note: In tMap, replace null value by "" as per above post.
Let me Know if it works.