Empty Header element

Hi everyone!

I have a little problem and I hope you can help me out. I have an excel file which has no headers so the data I need begin at row 7, row 1 is empty in most of the columns. With the Read Range activity you have the option to tick the checkbox “AddHeaders”. Now I want to know what header there is if I add one with the checkbox. How can I address the column in that way?

Best regards!

@felixrand
Welcome to the forum

Lets assume following:

  • row 1-6 are unneeded
  • row 7 contains the header names

a quick fixing could look like this:

  • read in Excel with read range, Ensure that add Headers is not marked, result: dtData

use an assign activity:
left side: dtData
right side: dtData.asEnumerable.Skip(6).CopyToDataTable

write out dtData to a new Excel - DataFiltered.xlsx

Now read in the created Excel DataFiltered.xlsx with marked add Headers option

Check the created column names

Another option would be to do the corrections inside the datatable and adopting the column names e.g.
dataTableVar.Column(1).Columnname = “NewName”

Thanks for your answer! I will try it out soon and I will come back and tell you if it worked :slight_smile:

Alternatively: Use ReadRange activity with Range = “A7” (assuming your data start from column A, row 7)

If AddHeaders = true the first row in the range will be treated a header row and columns will be named according first row content
If AddHeaders = false columns will be named Column1, Column2…