Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Apologies if it sounds a stupid question. I need to do data cleaning as below
| Original Data | Transformed Data expected |
| MAY 1000394 | MAY1000394(remove spaces and convert to UpperCase) |
| MAY 73-4506 | MAY73-4506(remove spaces and convert to UpperCase) |
| MAY v 1915 | MAYV1915(remove spaces and convert to UpperCase) |
| MAY-P8181 | MAYP8181(and convert to UpperCase, also remove '-' after MAY) |
please help out with a solution
Regards,
Meena
Here is the solution in a tMAP
Here is the code: in.originalData.trim().replace(" ","").replace("MAY-","MAY").toUpperCase()
Is that what you need?
EDIT: better do this in this way : in.originalData.trim().replace(" ","").toUpperCase().replace("MAY-","MAY")
@muralam - is this the complete data set or these are few samples. The reason to know if the data & the "-" are in fixed positions, or variable.
Here is the solution in a tMAP
Here is the code: in.originalData.trim().replace(" ","").replace("MAY-","MAY").toUpperCase()
Is that what you need?
EDIT: better do this in this way : in.originalData.trim().replace(" ","").toUpperCase().replace("MAY-","MAY")