Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilsh1
Contributor III
Contributor III

Replace a string in Talend

Hi ,
I am having one complete line e.g 1|null|test.
I have to replace null with the ""(empty string) in Talend .
its a complete line and not a separate column.Because in our case its dynamic column content which are coming into one single column..?
Labels (2)
8 Replies
Anonymous
Not applicable

Hi,
its a complete line and not a separate column.Because in our case its dynamic column content which are coming into one single column..?

That means you cannot use method
ReplaceAll(string s1, string s2)

in tMap?
Best regards
Sabrina
Anonymous
Not applicable

I would use the replace method from String.replace
s = s.replace("null", "\"\"")
janhess
Creator II
Creator II

Or even s.replace("null","")
Anonymous
Not applicable

Hi nikhilsh,
Is there any update for your issue?
Best regards
Sabrina
nikhilsh1
Contributor III
Contributor III
Author

yes thank you for your update .its working but i want the output as dynamic column again and not the string as
we are converting it the string for processing ..
Anonymous
Not applicable

Nikhil,
What is your output - file or database? support for dynamic schema will depend on that.
Thanks,
Nishad Joshi.
nikhilsh1
Contributor III
Contributor III
Author

its a file not the database.we are creating it as input for our external table
Anonymous
Not applicable

Then whatever you are saying is possible... you'll need more than one tMap to achieve this. Just make sure layout of the file does not change during transformation. One more thing, tSetDyanmicSchema component supports only positional file. For any other file type (Delimited, etc.), dynamic schema is your best bet.