Ignoring the Extra Columns/Rows during the Data Scrapping (from DAta TAble)

Hi guys,
there are 4 columns in datatable over a web page and I wanted to extract only 3 columns data.

Please suggest me with something.

Regards.

Hi Syed- May i know the issue exactly, As of now you are getting the whole tables in your scraping? and ignore the specified columns? or you are not able to extract the data from the data table at al?

Hey Hi Pradeep,

There is a data table with Column A,B,C so i dont want C. even C is getting extracted.
How should i scrap it ?
even I tried an option which pop-ups before scrapping entire data table, im ending up in something else.

@Syed_Shahbaz_Ali

Follow below steps.

  1. First scrape the entire Table from web page using Data Scraping and will give output as DataTable. Let’s say ‘InputDT’.

  2. And then try below expression to get required columns from it.

            OutputDT = InputDT.DefaultView.ToTable(False,"Column 1","Column 2","Column 3")

Hi

There are two ways to handle this

  1. First we can restrict the number of columns we want while we are data scrapping the data from a application
    For more details on how to extract as such
    Example of Using Data Scraping

  2. And if you have no other way of extracting the specific columns with data scrapping then scrape it completely and get the output as datatable named Extractedtable

Now use a assign activity like this

Dt_final = Extractedtable.DefaultView.ToTable(FALSE,”Column-1”,”Column-2”,”Column-3”)

Here
DefaultView will help us get the specific column we want
ToTable will convert the expression back to datatable variable
FALSE is mentioned to ensure all rows are obtained
If we want to delete the duplicate rows then mention as TRUE

And
We can mention the column names we want between double quotes

That’s it

Hope this would help you resolve this

Cheers @Syed_Shahbaz_Ali

Hi ,

I tried this,
but not able to get the proper o/p
could you please correct me.

i think this FALSE will exclude the upcoming written Columns, isn’t it ??

true

you mean to say that ,
this TRUE will delete column-2 ?

Please Tell

Whatever columns we mention here only those will be there in the new datatable
Say for example if you have four columns and now as you have mentioned only till column-3
Those 3 columns only will be there in the output dt

Hope this clarifies your query

Cheers @Syed_Shahbaz_Ali

@Syed_Shahbaz_Ali

No.
Here, the Boolean flag True or False refers to whether we want to exclude or include duplicate rows based on mentioned columns.

True - Exclude Duplicate rows
False - Include Duplicate rows