Created 05-19-2021 02:52 PM
I'm trying the processor ReplaceText to change all my dot to comma, but i can't
I really need some help here, please.
This is my CSV file:
MONEY (header)
109.29
I need this result
MONEY (header)
109,28
Created 05-20-2021 02:20 PM
@Acbx
You should be able to easily do this based on your example easily with the ReplaceText processor configured as follows:
If you found this addressed your query, please take a moment to login and click accept on the solution.
Thank you,
Matt
Created 06-07-2021 07:16 AM
Hi Matt
It doesn't work.
I dont know why but it has created 5 more columns
Created 06-07-2021 08:34 AM
@Acbx
It looks like your CSV uses commas as the field delimiter. So the solution i provided parses the entire file line by line and changes all "." to ",". So, I am guessing that you have other places within your CSV that also had ".", thus creating the additional 5 field columns.
Are trying to create a new column for cents? Is that why you are changing 109.29 tp 109,29?
If you are not looking for a new column, how will downstream system parse this edited CSV now that you added a new comma in there?
You could write a complex Java regular expression in the Search Value to match only specifically on column number X (Money Column) and then use Replacement Strategy "Regex Replace" to edit it.
Let's assume the "Money" Column was column number 5. And then wrap money once converted from 109.29 to 109,29 in quotes so it is not treated as two columns later on....
Search Value:
^(.*?),(.*?),(.*?),(.*?),(.*?),(.*?)$
Replacement Value:
$1,$2,$3,$4,"${'$5':replace(".",",")}",$6
So above would manipulate column 5 only and change 109.29 in to "109,29".
Hope this helps you,
Matt