on 05-22-2017 1:34 PM
I have created a mapping. There is a source field which contains some data and its coming with spaces between the data. Now i don't want spaces in output. How to remove extra spaces.
Source Field= ABCD EFGHIJKLMNBBBBBBSSJJ
Expected Output: ABCDEFGHIJKLMNBBBBBBSSJJ
Please help on priority
Hello,
You can use Replace function - ' ' with ''.
Regards,
Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankit,
You can use Standard Mapping function "trim" to remove the spaces. No need to use UDF.
If you need to remove * then use standard function "ReplaceString" in the mapping. Input1: Your string; Input2: "*"; Input3: "" (Ignore " double quotes)
Thanks/Lokesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankit!
This java expression returns the string without extra spaces. You can use it in UDF.
<code>String myStr = myStr.trim().replaceAll(" +"," ");
If you need to remove ALL the spaces, not just the EXTRA spaces, you can use suggestion given above.
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Source Field= ABCD*********************************EFGHIJKLMNBBBBBBSSJJ
Expected Output: ABCDEFGHIJKLMNBBBBBBSSJJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.