Related to excel question

Hi All.

In a excel i have balance column
₹123.45
₹234.67 like this
I need to change only rupee symbol to dollar symbol in uipath not the value how we can do that?

Can you please suggest some answers

1 Like

@317-Hemalatha_G

Welcome to our UiPath community.

  1. First 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 currentRow in dtInput
                  currentRow("balance") = currentRow("balance").ToString.Trim.Replace("₹","$")
    
  3. Finally use Write Range activity and pass above dtInput to write back into the excel file.

Laxman i have tried your solution but not getting actual result

1 Like

(From r In DT_Data.AsEnumerable Let ra = r.ItemArray.Select(Function (x) x.ToString.Trim.Replace(“rupee sympol”,“$”)).toArray() Select DT_Data.Rows.Add(ra)).CopyToDataTable()

it will work, lets try this

Hey @317-Hemalatha_G

When you read it from Excel into a Data Table are you getting the rupee symbol along ?

Thanks
#nK

@317-Hemalatha_G

Can you please print the balance column values and share the screenshot here.

i have used the above code in my process but showing this exception

1 Like

Hey @317-Hemalatha_G

Kindly try the updated query below,

(From r In DT_Data.Copy().AsEnumerable Let ra = r.ItemArray.Select(Function (x) x.ToString.Trim.Replace(“rupee sympol”,“$”)).toArray() Select DT_Data.Rows.Add(ra)).CopyToDataTable()

Thanks
#nK

i have a doubt in that r we have give like this Row(“Remaining Balance”)

1 Like

Hey @317-Hemalatha_G

In that code snippet, the replace is actually done for all columns !

Thanks
#nK

now i have tried your updated code nithin it shows like this

1 Like

Hey @317-Hemalatha_G

The error source here seems to be on For-Each Row, guessing it’s not due to this statement.

Thanks
#nK

Hi Laxman

My Actual output in the excel be like this

pin your xaml i will solve it

Sub Macro1()

’ Macro1 Macro


Cells.Replace What:=“$”, Replacement:=" ", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End Sub

you can also use macro for replace

Hi Veera_Raj i will place my xaml file and also output file over here
Sequence.xaml (37.4 KB)
Lurie.xlsx (6.1 MB)

i have gone through your excel its column data type is currency in your excel thats why whenever you try to replace its not working

newseq.xaml (7.1 KB)

its working fine use it

1 Like