How to split an excel file into 2 files based on a list,

In your case we do groupBy by 1 key

(From d in YourDataTableVar.AsEnumerable
Group d by k1=d(“Group”).toString.Trim grp=Group
Select t=grp.CopyToDataTable).toList

Also Have A look here:

1 Like