You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@hop.apache.org by "TushR-pawar (via GitHub)" <gi...@apache.org> on 2025/04/15 09:41:41 UTC
[D] Validate .xlsx headers and abort if required fields are missing (hop)
GitHub user TushR-pawar created a discussion: Validate .xlsx headers and abort if required fields are missing
Hi everyone,
I’m trying to validate the fields present in .xlsx files as part of a workflow in Apache Hop.
My goal is:
To check if all expected fields (headers) are present in the Excel file.
If any expected header is missing, I want to abort the workflow.
The challenge is:
These .xlsx files contain only the header row — there is no actual data in the sheet.
Is there any workaround or reliable way to read just the headers from .xlsx files and validate them in Apache Hop?
Any suggestions or ideas would be really helpful.
Thanks!
GitHub link: https://github.com/apache/hop/discussions/5180
----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org
Re: [D] Validate .xlsx headers and abort if required fields are missing (hop)
Posted by "TushR-pawar (via GitHub)" <gi...@apache.org>.
GitHub user TushR-pawar added a comment to the discussion: Validate .xlsx headers and abort if required fields are missing
Got it, Thanks @hansva !!
GitHub link: https://github.com/apache/hop/discussions/5180#discussioncomment-12843473
----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org
Re: [D] Validate .xlsx headers and abort if required fields are missing (hop)
Posted by "hansva (via GitHub)" <gi...@apache.org>.
GitHub user hansva added a comment to the discussion: Validate .xlsx headers and abort if required fields are missing
The trick to do this is to create generic fieldnames, just give them number 1 -> 50 if you expect a maximum of 50 columns.
In the Sheets tab, you set the start row to -1 and in the content tab you set the limit to 1 row.
If you do this, you will get a single row containing the field names. I usually then follow up with a Row Normaliser to transpose the columns to rows, and then you can compare to your validation set
GitHub link: https://github.com/apache/hop/discussions/5180#discussioncomment-12839973
----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org