Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I have a String data "\N" in timestamp column and I'd like to replace this character into "null", then convert the type from STRING to DATE.
How can I define the conversion rule in tMap ??
@wakkieeeeee ,you need to define manually in tmap for each column.
@wakkieeeeee ,you can use the below way.
row3.newColumn1.replaceAll("/N","NULL").equals("NULL")?null:TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",row3.newColumn1 )
row1.data.replaceAll("\\\\N", "")The above would replace \N to nothing in your string "data"
TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",
"<Your string here>")Use above to parse date from string
Hi there,
Thank you for your advise!
Thanks to your help, I could replace the "\N" to "null" and convert from STRING to DATE.
By the way, I have to do the same things on the all columns..
How do I cope with it with tMap?
I assume that I can utilize the Var function.
The function I created is the below;
row2.session_start_time.replaceAll("\\\\N","NULL").equals("NULL")?null:TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",row2.session_start_time)
How can I apply this function to all columns??
@wakkieeeeee ,you need to define manually in tmap for each column.
I have to remove double quotes from string but its throwing me below in tmap.
error msg: