How to replace a point in tMap/StringHandling.CHANGE

One Star

How to replace a point in tMap/StringHandling.CHANGE

Hello,
I want to replace a point (.) in a tMap with nothing. I use StringHandling.CHANGE(row1.D,".","") but all the characters are out.
How can I do ?
Excuse me for my poor english ...
Thanh You
Employee

Re: How to replace a point in tMap/StringHandling.CHANGE

Use this code:
StringHandling.CHANGE(row1.D,"\\.","")

Second parameter is considered as a regular expression, it seems to me this basic function shouldn't use regexp to replace strings.
You can add a feature in our Bugtracker to add a "simple" replace strings function.
One Star

Re: How to replace a point in tMap/StringHandling.CHANGE

Thank You !

Re: How to replace a point in tMap/StringHandling.CHANGE

Hello all,
Can you please help in converting the date 2015-02-02 07:54:50 to 20150202075450 please ?
I have been trying the below in a tMap but is issues errors :
StringHandling.EREPLACE(StringHandling.EREPLACE(row1.my_date,"-",""),":","").

It is normal somehow since the input value has type "date" whereas EREPLACE considers type "string". Can you please advise on what I shall use to get this done ?

Thank you and best regards,
Gabriel 
One Star

Re: How to replace a point in tMap/StringHandling.CHANGE

Hello Gabriel,
Think you just want to do Date Format function instead:
TalendDate.formatDate("yyyyMMddhhmmss", row1.my_date)
This will take any Date column and convert it to a string in the format you specify.
Five Stars

Re: How to replace a point in tMap/StringHandling.CHANGE

If you still looking for solution then, I would suggest first parse the original date then use above Date format to get the desire output. 
e.g. 
System.out.println(TalendDate.formatDate("yyyyMMddhhmmss", TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", "2015-02-02 07:54:50")));