How to split word and number ( NRS 1200 ) of excel column price in UiPath

image
how to split word and number ( NRS 1200 ) of excel column price in UiPath

1 Like

Hi @Bammy

Use this in Invoke Code activity

DT.AsEnumerable.ToList.ForEach(Sub(r)
    r(3)=r(3).ToString.Split(" "c).Last()
End Sub
)

Cheers!!

Have a look here, using Regex
grafik

refering to the groups:
grafik

You can use SPlit method also Split with space
Then you can assign those and use them as required.

Hi @Bammy

=> Build Data Table
image
Output-> resultTable

=> Read Range Workbook
image
Output-> dt

=> Use below syntax in Assign:
resultTable = (From row In dt.AsEnumerable() Let parts = row.Field(Of String)("Price").Split(New String() {" "}, StringSplitOptions.RemoveEmptyEntries) Select resultRow = resultTable.Rows.Add(parts.FirstOrDefault(), If(parts.Length > 1, Integer.Parse(parts(1)), Nothing)) ).CopyToDataTable()

=> Write Range Workbook dt
image

Hope it helps!!

@Bammy

Please try this

DT.AsEnumerable.ToList.ForEach(Sub(r)
    r(4)=r(3).ToString.Split(" "c).First()
	r(3)=r(3).ToString.Split(" "c).Last()
    End Sub
)

Input:

image

Output:

image

Cheers!!

Hi @Bammy

Input:-

Output:-
image

Xaml File:-
Split datacolumn forum.zip (3.6 KB)

If this works for you, please mark it as a solution. So others can refer the same.

Thanks