Replace dot with comma

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?

@yulya

  1. Use Read Range activity to read the data from Excel file and it will give output as DataTable. Let’s say dtInput.

  2. And then use For Each Row activity to iterate one by one row.

      For Each row in dtInput
         row("Level") = row("Level").ToString.Replace(".",",")
    
  3. 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(".", ",")

I fixed it but the error didn’t go away.


left side should be CurrentRow("Level") not CurrentRow

1 Like

@yulya

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!

1 Like

image
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.