Hello everybody,
I have a table, I need to replace the dot with a comma in column 2. please tell me how can this be done?
-
Use Read Range activity to read the data from Excel file and it will give output as DataTable. Let’s say dtInput.
-
And then use For Each Row activity to iterate one by one row.
For Each row in dtInput row("Level") = row("Level").ToString.Replace(".",",")
-
Finally use Write Range activity and pass above dtInput to write back to the Excel file.
Hi @yulya
FYI
another solution using LINQ
lets say u have read this in datatable
using linq try this expression
(From r In dtData.AsEnumerable
let ra = r.ItemArray.Select(Function (x) x.ToString.Trim.Replace(“.”,“,”)).toArray()
Select dtdataResult.Rows.Add(ra)).CopyToDataTable()
Use statement from above within an assign and assign it to an empty dataTable : dtdataResult
thanks
the expression row(“Level”) = row(“Level”).ToString.Replace(“.”,“,”) needs to be written to what activity?
@yulya You can use Assign Activity
you forgot “Level”
CurrentRow("Level").toString.Replace(".", ",")
left side should be CurrentRow("Level")
not CurrentRow
Use Assign activity inside loop and pass left and right hand side values as below.
Left-side: currentRow(“Level”)
Right-side: CurrentRow(“Level”).toString.Replace(“.”, “,”)
it is works, thank you!
when I used the replacement, some values were divided into digits incorrectly, for example, I had a value of 28.3352, but it became 283, 352
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.