Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have an input like below
Input File Data
Smith,john
James,Jones K
Joseph J Walker
Need Expected Output like below split FullName column to 3 different Columns
FirstName | MiddleName | LastName |
John | Smith | |
James | K | Jones |
Joseph | J | Walker |
kindly help on this i tried using textractregexfield component but not able to get expected output
Regards,
Meena
You just have to check the last part length to decide if you have to get the middle or the last part to populate the lastname:
Here is the result:
[statistics] connecting to socket on port 3468 [statistics] connected .---------------+------+------+------. | tLogRow_1 | |=--------------+------+------+-----=| |fullname |first |middle|last | |=--------------+------+------+-----=| |Smith,john |Smith |john |null | |James,Jones K |James |K |Jones | |Joseph J Walker|Joseph|J |Walker| '---------------+------+------+------' [statistics] disconnected
Thank's to mark you case as solved (Kudos also accepted as a bonus).
Based on this answer I have proposed to someone else, you should be able to do what you want.
Start by replacing comma by space using the following expression row1.input.replaceAll(",", " ") then follow this explication https://community.talend.com/t5/Design-and-Development/String-Handling-in-Tmap/m-p/141342#M87305
@TRF,
But I am getting the output like below which is not expected
tLogRow_2 |
|=-------------=|
|FullName |
|=-------------=|
|smith john |
|taylor mary A |
|jhonson david |
|joseph j walker|
'---------------'
.---------+----------+--------.
| tLogRow_3 |
|=--------+----------+-------=|
|FirstName|MiddleName|LastName|
|=--------+----------+-------=|
|taylor |mary |A |
|joseph |j |walker |
@muralam share your tMap
kindly help attached is the job i tried to get output as expected but i am not able to figure where the issue is exactly
Try the with the proposed solution
@TRF,
Thanks for the response, i got the expected result of course not completely
from the screen shot attached i have to handle
if LastName length =1(means LastName is single letter) assign LastName to MiddleName and MiddleName to LastName, could you please help with this issue am i missing something
FirstName|MiddleName|LastName|
|smith | |john |
|taylor |mary |A |
|jhonson | |david |
|joseph |j |walker |
Expected Result is like below
FirstName|MiddleName|LastName|
|smith | |john |
|taylor |A|mary|
|jhonson | |david |
|joseph |j |walker |
kindly suggest
Regards,
Meena
You just have to check the last part length to decide if you have to get the middle or the last part to populate the lastname:
Here is the result:
[statistics] connecting to socket on port 3468 [statistics] connected .---------------+------+------+------. | tLogRow_1 | |=--------------+------+------+-----=| |fullname |first |middle|last | |=--------------+------+------+-----=| |Smith,john |Smith |john |null | |James,Jones K |James |K |Jones | |Joseph J Walker|Joseph|J |Walker| '---------------+------+------+------' [statistics] disconnected
Thank's to mark you case as solved (Kudos also accepted as a bonus).
@muralam, thank's to mark your cas as solved