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

Modify an or bar | to a space in an input field

I have an input file where our field separator is an or bar and there is a text field where people can enter anything in. I want to modify any or bar | entries to a space in that field so we do not have a conflict.

I've tried in tMap:
row11.Notes.replaceAll("|", " ") - gives a null pointer exception

row11.Notes.replaceAll("\|", " ") - compilation error

row11.Notes.replaceAll("\\|", " ") - gives a null pointer exception

Is there a way to do this in tMap or is it some other way that I need to address this?

Labels (3)
1 Reply
Anonymous
Not applicable
Author

Hi,

 

   Since you are reading the data to various columns based on delimited pipe character, you need to do the data parsing before reading the file. Else any pipe symbol inside the delimited file will be considered as a column delimiter.

 

   The most easy way to overcome this issue is to ask the source system to add text enclosure character to your input file. In this way, any data inside text enclosure characters will be considered as part of data. This data can be replaced later using replaceAll function.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved