DELETING EMPTY COLUMNS FROM THE DATATABLE

Hi Team,

I am in the process where I have to extract the data from the website (there are 5 columns in the beginning), on which i perform the data manipulation.

I need to add 4 more columns into it while data manipulations at the end of it.

When I am extracting the data using data scraping, (and write in excel) I am getting 3 empty columns(without any headers also) in between and when I am adding 4 columns as expected, I am getting total 12 columns instead of 9 columns.

Expectation:- 5 earlier columns + 4 Required columns = 9 columns.
Reality:- 5 earlier columns + 3 un-invited columns + 4 Required columns = 12 columns.

In the above mentioned order.

I need a solution where I can eliminate the 3 un-invited, headerless columns and get the required data.

Kindly help @lakshman, @Lahiru.Fernando, @aksh1yadav, @Palaniyappan, @HareeshMR

Thanks and Regards,
@hacky

https://docs.uipath.com/activities/docs/filter-data-table

  1. Columns Selection Mode - Specifies whether to filter the columns by keeping or removing them. This can be done by selecting the Keep or the Remove radio buttons. Selecting Keep only keeps the columns that are specified below, while selecting Remove deletes the rows that are specified below from the input DataTable . —> Use Keep
  2. Column - The columns you want to keep or remove from the datatable → Mention your column names whichever required

@hacky

After scraping the data and assign result to one DataTable variable. And then use below expression to read required Columns.

       newDT = yourDT.DefaultView.ToTable(False,"Column 1","Column 2", ...,"Column 5").CopyToDataTable

its done

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.