I have a string number like this:
1.000.000.00
So I have to delete all dots except last one, it will look like this:
1000000.00
Also if there is only one dot it should keep it.
Example:
INPUT | OUTPUT
-----------------------------------
1.00 | 1.00
1.000.00 | 1000.00
What I tried:
I create a derived column with this expression
LEFT([Column],FINDSTRING([Column],".",LEN([Column]) - LEN(REPLACE([Column],".",""))) - 1)
+ SUBSTRING([Column],FINDSTRING([Column],".",LEN([Column]) - LEN(REPLACE([Column],".",""))) + 1,LEN([Column]))
It keep the first dot not the last one.
question from:
https://stackoverflow.com/questions/65893761/how-to-replace-all-occurrence-of-a-character-except-last-in-a-string-in-ssis 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…