I have to copy a large matrix from a csv file to an excel file. The csv has the “,” as decimal separator and doesn’t have any group separator.
My xaml has two activity:
When I launch my process, the output excel file has a wrong number format, for example:
csv number → 3,6000
excel number → 36000.
I changed the decimal and group separator from my Control Panel, but I had the same result. “It seems that UiPath doesn’t consider this modify”.
Does anyone have any suggestions?
PS: I have a large matrix and I can’t format number by number (for reason of time).
November 19, 2019, 1:41am
It seems it’s locale matter and is very complicated sometimes.
I suppose there are some workarounds.
First workaround will be the following.
Change OS or EXCEL setting for decimal separator to “,” in advance.
Use Start Process Activity and directly set your csv filename to FileName property.
Then you can see the value as decimal in your EXCEL.
Save this book as xlsx
Finally you can handle it using Read Range Activity.
Second Workaround is the way to replce “,” to “.” in csv.
Read whole csv as string using Read Text File Activity.
Replace “,” to “.” using String.Replace method or System.Text.RegularExpressions.Regex.Replace method.
In general, these method process fast.
Write this string to text file using Write Text File Activity.
I try the second workaround. I have to use the regular expression substitution because I have to replace only commas in number (in my csv are present some customerID and description with commas, so I can’t include these in the substitution).
How can I create a regex to perform it?
my starting string → customerID;here I have the customer description with some commas,;3,6000;3,6000;3,5900
desired output string → customerID;here I have the customer description with some commas,;3.6000;3.6000;3.5900
November 19, 2019, 11:42am
You can get it using
Replace activity with the following settings.
If your value is fixed length like n.nnnn, the Pattern property might be