Removing excess rows

How to remove excess rows? How will I do this in UiPath?

Sample.xlsx (9.5 KB)
1 Like

Hi @ROBERT_RUSSELL_MONSA,

Please follow the below steps.

  1. Read the excel or csv and store it in a DT.
  2. 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

Hi @ROBERT_RUSSELL_MONSA

Below is the workflow for the same.
Sample.xlsx (9.6 KB)
MainPratik.xaml (9.3 KB)

Workflow :-
image

Input :-
image

Output :-
image

Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

2 Likes

Hi @Pratik_Wavhal,

Amazing effort… Rock and Roll… Cheers…

Warm Regards,
Ranjith Udayakumar

1 Like

Hi @ranjith_udayakumar

Thanks for compliment. :blush:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

Hi @ROBERT_RUSSELL_MONSA

You can just remove empty rows with one single assign activity using LINQ query, steps as below

  1. Read range as dtInput
  2. 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()

  1. Now you have dtInput with empty rows removed , this dtInput can be used as input dt in your further process
3 Likes