You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2013-01-22 09:20:35

ae_kel29
Member
136 posts

ae_kel29 said:

To remove unnecessary characters in string

Hi,

I just wonder how do I wants to removed certain character or word in string.

For example, there is string with data "good-morning". Then i wants to remove "-morning" and then the data will become as "good" only.

Plz help me sad


Regards,
Kal

Offline

#2 2013-01-22 09:46:59

xdshi
Talend Team


xdshi said:

Re: To remove unnecessary characters in string

Hi,

tFileInputPositionalComponent and tFileInputRegex component can meet your needs.

Best regards
Sabrina


What we can do is to make sure that Talend will be your best choice!

Offline

#3 2013-01-22 10:20:10

janhess
Member
1315 posts

janhess said:

Re: To remove unnecessary characters in string

Or in a tMap you could use column_name.replace("-morning","")

Offline

#4 2013-01-23 10:04:03

xdshi
Talend Team


xdshi said:

Re: To remove unnecessary characters in string

Hi, ae_kel29

I just wonder how do I wants to removed certain character or word in string.

If your requirement is just the example you set, the way @janhess provided is very good for you.
But if your real work have a lot of strings, it suggestion that use column_name.substring(int startIndex, int endIndex) in tMap.

Best regards
Sabrina


What we can do is to make sure that Talend will be your best choice!

Offline

#5 2013-01-23 10:16:04

janhess
Member
1315 posts

janhess said:

Re: To remove unnecessary characters in string

column_name.substring(int startIndex, int endIndex) in tMap.

This assumes the string to replace is in a fixed position.

Offline

#6 2013-01-24 04:22:13

xdshi
Talend Team


xdshi said:

Re: To remove unnecessary characters in string

Hi,

Yep, it depends on the replaced strings.

Best regards
Sabrina


What we can do is to make sure that Talend will be your best choice!

Offline

#7 2017-03-20 18:17:10

eliton
Guest

eliton said:

Re: To remove unnecessary characters in string

Hi There

How do i remove stranges caracteres li "" on tmap when passing a string??

#8 2017-03-21 09:42:21

xdshi
Talend Team


xdshi said:

Re: To remove unnecessary characters in string

Hi eliton,
For you requirement, you can use method "ReplaceAll(string s1, string s2)" in tMap component expression.
Best regards
Sabrina


What we can do is to make sure that Talend will be your best choice!

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy