How to remove excess rows? How will I do this in UiPath?
1 Like
Please follow the below steps.
- Read the excel or csv and store it in a DT.
- Filter the rows which has values and store it again same DT or new DT.
Datatable = Datatable.Select(“[Name]” isnot Nothing).CopyToDataTable().
It will give all non empty Name Rows as a table.
Warm Regards,
Ranjith Udayakumar
Below is the workflow for the same.
Sample.xlsx (9.6 KB)
MainPratik.xaml (9.3 KB)
Workflow :-
Input :-
Output :-
Mark as solution and like it
Happy Automation
Best Regards
Er Pratik Wavhal
2 Likes
1 Like
1 Like
You can just remove empty rows with one single assign activity using LINQ query, steps as below
- Read range as dtInput
- Use this in assign activity . This will remove empty rows from dtInput.
dtInput=dtInput.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable()
- Now you have dtInput with empty rows removed , this dtInput can be used as input dt in your further process
3 Likes