Filter Data & For Each Row

Hello all,

I have excel file alot of DLV & DLVS, I have to sort M4 & D4 to A-Z and get DLVS on top then DLV.

How can soft & filter data For Each Row in Data Table. Thank all

Hi,

Can you try the following expression?

keywords = {"DLVS-","DLV-"}

Then

dt = dt.AsEnumerable.OrderBy(Function(r) Array.IndexOf(keywords,System.Text.RegularExpressions.Regex.Match(r("ColumnD").ToString,"^.*?-").Value)).ThenBy(Function(r) r("ColumnM").ToString).CopyToDataTable

Please modify column name

Regards,

Hi,

Can you explain more for me?

Hi,

Can you share your project or workflow as file?

Regards,

1 Like

Hi @anh.nguyen

Can you try with

(From d In yourDt.AsEnumerable()
Order By If(d("Column1").ToString().Trim() = "DLVS", 0, 1)
Select r = d).CopyToDataTable()

Regards

1 Like

Hi,

Can you check which type dt variable is? The above expression assumes dt is DataTable.

Regards,

1 Like