Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm new at Talend and I'm trying to do something very simple in MYSql that I dont know how to do it here
For example:
I have a full neme as : "FName , LName MInitial Title"
I want to subtract just the Name and last name ignoring the middel initial and the Title.
in sql is replace(SUBSTRING_INDEX (FULL_NAME,' ',2),',','') as NewName
Result : FName LName
How I can achieve that?
Thanks in Advance
Hello NNYEZEL,
assuming that there is a blank before and after the comma, you can split the whole string at the blanks
and use the first and third result of the split. (The second would be the comma.)
row1.InputString.split(" ")[0] + " " + row1.InputString.split(" ")[2]
Best regards,
Thomas
Hello NNYEZEL,
assuming that there is a blank before and after the comma, you can split the whole string at the blanks
and use the first and third result of the split. (The second would be the comma.)
row1.InputString.split(" ")[0] + " " + row1.InputString.split(" ")[2]
Best regards,
Thomas
Hi,
The solution almost work
So the pattern is 'LName' 'space' 'comma' 'space' 'Fname' 'space' 'Mintial' 'Space' 'Title'
FULL NAME STRING = Test , Name M MD
output is coming as 'Test , M MD'
should be
row1.InputString.split(" ")[0] + " " + row1.InputString.split(",")[1]???
But is not working
Thanks for all your help
Hi,
Finally Works.. It take me a minute but is doing what I need...
Thank you for your help
row4.Name.split(",")[0] + " " + row4.Name.split(" ")[+1]