Try to read the Excel file to data table, and run for each loop,
put condition for example if datatable.rows.indexof(row)+1=datatable.rows.indexof(row)
add flag for your row so that u will not process duplicate entries
sorry for late reply. I’m currently grouping the data on plant code and using below LINQ code. It’s not appending comma , can you help?
(From d In dt_ExtractLog.AsEnumerable
Group d By k=d(“Plant Code”).toString.Trim Into grp=Group
Let cn = String.Join(“,”, grp.Select(Function (rn) rn(“Doc Number”).toString).toArray)
Let ra = New Object(){k, cn}
Select dt_ExtractLog1.Rows.Add(ra)).CopyToDataTable