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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to remove smileys/emojis from a string?

Hi All,

 

I have problem loading data from salesforce to mysql database. My data looks like below:

Data:  Hey, Please can this one be updated our side? 😊

I have created a simple one-to-one mapping. Tsalesforce input and tdboutput. 

I want to replace the smiley/emoji present in the string with a blank space. I am currently using tjavarow but it is not working. Any help on this will be really appreciated.

Labels (4)
4 Replies
Anonymous
Not applicable
Author

Hi,

 

Please try below method.

0683p000009M30C.png

 

0683p000009M2tW.png

 

0683p000009M30H.png

 

You need to use the below value for context variable.

 

"[^\\p{L}\\p{M}\\p{N}\\p{P}\\p{Z}\\p{Cf}\\p{Cs}\\s]"

The function used in tMap is as below.

 

row1.input.replaceAll(context.characterfilter,"")

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 🙂

 

Anonymous
Not applicable
Author

Hi @ikan 

 

     Could you please mark the topic as resolved since I have answered your query?

 

     Marking a query promptly will help others in Talend community when they are looking solutions for similar queries.

 

     It is also a way of telling thank you to the contributor for spending their time for your query in between their routine work.

 

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 🙂

Anonymous
Not applicable
Author

Hi Nikhil,

Thanks for your help.
But I still get error while loading data. All the smileys are not replaced.
Could you check my previous message and help please.
Anonymous
Not applicable
Author

Hi,

 

   Could you please try below value to the context variable?

 

"[\\ud83c\\udc00-\\ud83c\\udfff]|[\\ud83d\\udc00-\\ud83d\\udfff]|[\\u2600-\\u27ff]"

Please refer the details in below link. You may have to add additional regular expressions based on your emoji if this is also not clearing the emoji.

 

https://stackoverflow.com/questions/44620294/removing-special-character-from-java-string

 

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 🙂