I have an Excel sheet containing different items, each with an ITEM_CODE and purchase dates. I want to:
Filter the sheet to get only the rows for a specific item code.
Write all the matching rows to a new sheet called “A4 Books”.
What’s the best way to do this in UiPath? I’m looking for a simple and reliable approach to filter the data and write it without leaving old data behind.
Hello @Daniel_Oisebe try this approach
first read the excel in a datatable as dtinput then use this linq to filter based on the code dtfiltered = dtInput.AsEnumerable().Where(Function(row) row("ITEM_CODE").ToString.Trim = "A4").CopyToDataTable()
And Replace "A4" with the specific code then Write the filtered data to a new sheet
Use the Read Range activity to read the entire Excel sheet into a DataTable called DT1. Then use the Filter Data Table activity to filter rows from DT1 where ITEM_CODE equals the specific code you want and output the result to DTFiltered. After that, use the Write Range activity to write DTFiltered to a new sheet called “A4 Books,” making sure to overwrite any existing data.
If helpful, mark as solution. Happy automation with UiPath