How to split excel row

PFA,

I need to split last values in a row under Employee ID column values into BAR ID
I tried some split method it is not helping me

Can anyone help me out i will appreciate your support

Thanks in advance

Hi @rsr.chandu

Read the data into datatable using read range

Add a new column using add datacolumn

Then loop the datat table

Inside loop use assign currentrow(“newcolumnname”) = Currentrow(“Column1”).tostring.trim.Split(“ “c)(Currentrow(“Column1”).tostring.trim.Split(“ “c).count-1)

Paste the data back to excel if needed

Cheers

HI,

Hope the following sample helps you.

LINQ case

dt.AsEnumerable.Select(Function(r) dt.Clone.LoadDataRow({r("Employee ID").ToString,System.Text.RegularExpressions.Regex.Match(r("Employee ID").ToString,"\S+$").Value},False)).CopyToDataTable()

ForEachRow case

System.Text.RegularExpressions.Regex.Match(CurrentRow("Employee ID").ToString,"\S+$").Value

Sample20221111-3.zip (10.4 KB)

Regards,

1 Like

Thankyou it is working fantastic

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.