Finding specific header in Excel

I have header in Excel- ( Name , Address , Phone Number , Gender) but i have to check if the Excel contain these header or not ?

Please guide me how to do…?

@Tabish_Faridi

Use Text Exists activity whether the excel contains header or not.

Regards,
Karthik Byggari

Thanks for quick reply… can you please share any demo link or xaml if any.

Can you share the sample excel file please?

Sample Excel.xlsx (8.5 KB)

How you want to search the header I mean first you want the whole excel data and then you want to search that header or excel is open already and in that you want particular header to be searched?

Is there way to check header of an excel without opening, I guess No?

Take case- i am already in excel application scope - i want to verify only header. sample excel i have uploaded. please have a look.

p6.xaml (10.0 KB)

Hi @Tabish_Faridi
I think the above solution will help you out , just pass the keyword you want to search in the header of the excel. and you will get the result like true if it exist else false.

  • Use Read Rows with A1 as range. Output as FirstRow.
  • If FirstRow.contains(“Name”)=true
  • Writeline(“Name header exist”)

Thanks, Is it possible to verify all header in single go ? How?

Yes. You need to give AND operator.

If (FirstRow.contains(“Name”) and FirstRow.contains(“Address”) and FirstRow.contains(“Phone Number”) and FirstRow.contains(“Gender”))

Thank you. It worked :+1:

Great. :slightly_smiling_face:

Please mark the solution as solved.

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