How to remove unwanted header in excel

Hi Team,

I have extract table with header, I am using data scraper it will get header and table but unwantedly coming default header(Column 0, Column 1) like that, so i want remove that particular unwanted header from data table please help me anyone for this.

Input:
image

Expected output:
image

Regards,
Raja G

check the different activities related to excel read/write on the addHeaders option and set it on/off as needed

Hi @ppr ,

I don’t want excel, so im not use excel read write, i want only to get data table output only

Can you share your workflow?

we assumed excel as triggered by the screenshot

On datatable base you can do:

  • check the column names
  • if the auto generated names are used
    • then: use first row for column name renaming and remove afterwards the first row e.g. with LINQ or Remove DataRow Activity
1 Like

Hi @supermanPunch ,
Please help me on this

Hi @Raja.G

While Using the Data scrapping it self use the Column name correctly and just write the Dt in new excel.

Regards
Gokul

Hi @Raja.G ,

As already suggested by @ppr , If you need to rename the columns in a Datatable itself then we can go ahead with Renaming the columns using the First Row values. A More descriptive step is mentioned in the below post :

Also, Do Check on the retrieval stage itself whether we get the Column Names as it is required.

Let us know what you have tried and it’s outputs.

Change Column1 … to whatever you want
image

Yes i tried i couldn’t able to get this, i can able to get only entire table

Hi @supermanPunch , this one working fine.
I have one more queries,

Dt1 :

Column - A B C D
Empty value

Dt2 :

1st Row Value - 1 2 3 4
2 nd Row value - 5 6 7 8

My expect output:

Dt1 :

A B C D

1 2 3 4

5 6 7 8

Currently i get this output :

Dt1 :

A B C D 1 2 3 4
5 6 7 8

Pls give solution @supermanPunch , I’m using only datatable. Not using excel.

Hi @AJITH_SK ,

We would ask you to create a Separate Topic if the Requirement differs from the Initial Requirement post. However, Similar/Same approach could be applied to your case as well.
Here, We would first require to fetch the column names present in DT1. We can do so like below :

columnNames = DT1.Columns.Cast(Of DataColumn).Select(Function(x)x.ColumnName.ToString).ToArray

We could loop through the columnNames array and update the DT2 Column names like mentioned above in post.

We could also try using For Each row Activity and update the DT1 datatable with DT2 row values.

Function (x) x. columnName - what value i give?
x means? @supermanPunch