Clean up excel

Hi all,

I want to clean up excel above a certain text in excel file. For example I want get only the table below “Contact Person” and clean up everything above it.

Any idea how to achieve it. Thanks in advance.

Regards ,

You could

  1. Read the whole excel as datatable
  2. Use for each row and check if “Column1” value is Name
  3. Get the index from for each row activity
  4. Read excel from the obtained index for example “A22” with headers.

Thanks for responding. But is there there any solution using Dt.Select. I want to avoid looping.

Hi @vkshambhu

You can try the way as suggested by @jeevith. like u can read the excel file using read range starting A22 and storing in datatable and then writing the datatble in same excel file using write range activity. It will overwrite existing content in datatable and add the datatable which is provided as input to write range

Hope it helps you

Regards

Nived N
Happy Automation

Sorry but it doesn’t serve my purpose. I have quite few tables to be extracted from this excel in similar way. I will end up using multiple read range activities. Hence looking for a simpler way.

Hi @vkshambhu why can’t u go for looping concepts by putting the above activities in loop.

hi u mean there are many tables inisde the excel file sheet or can u share the screenshot well to understand

@vkshambhu… if you are just looking for read from row 22 then pls try

Assign = YourDt.AsEnumerable.Skip(21).CopyToDataTable