now i want to get only Used cars details with headers and store it into a new sheet
Hey @Chirag12 ,
To get only the Used Cars value , you can try below LINQ
YourDT.AsEnumerable.Where(Function(row) (row("Condition") Is "Used" Or Convert.Tostring(row("Condition")).Trim.Equals("Used"))).CopyToDataTable()
Hope it helps you
Try this
Dt.AsEnumerable.Where(function(x) x("Condition").ToString.Equals("Used")).CopyToDataTable
Cheers
@Chirag12, Glad that I could help you!
Just use Filter Data Table. Stop overcomplicating things trying to do it with LINQ.
Actually it is a dummy data, and i needed linq because i have huge data in excel
Everyone thinks LINQ is necessarily faster. It isn’t. Try Filter Data Table. In fact, it just has LINQ inside it anyway.
Hi @Chirag12
=> Use read range workbook activity to read the excel file and store it in a datatable. Let’s called variable name as dtInputdata
=> Use the linq query in assign activity
- Assign -> dtOutputdata = dtInputdata.AsEnumerable.Where(Function(row) row("Condition").equals("Used")).CopytoDatatable
=> After the assign activity use write range workbook activity to write the dtOutputdata variable in to the same excel.
Hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.