Skip to main content
Question

verify file header

  • Apr 7, 2020 9:26 AM UTC
  • 4 replies
  • 157 views

maica
Contributor
Forum|alt.badge.img+4

Hi, I would know if exist a transformer that verify if file header is correct. Thanks

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

itay
Supporter
Forum|alt.badge.img+19
  • Supporter
  • Apr 7, 2020 9:29 AM UTC

Hi @maica,

Can you provide some more info? what kind of file/format? what is a 'correct' header? and can you provide a file to test?

 


maica
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • Apr 7, 2020 9:41 AM UTC

Hi @maica,

Can you provide some more info? what kind of file/format? what is a 'correct' header? and can you provide a file to test?

 

Hi, the file is a simple csv that has a header. I would the ETL fails if the header change.


david_r
Celebrity
  • Apr 7, 2020 1:36 PM UTC

One way to validate a CSV header might be to use a dynamic CSV reader followed by a Tester to check for "Attribute is missing" on the attributes you expect to find in the CSV.


itay
Supporter
Forum|alt.badge.img+19
  • Supporter
  • Apr 7, 2020 1:55 PM UTC

Hi, the file is a simple csv that has a header. I would the ETL fails if the header change.

You might want to have a look at the Schema (Any Format) reader. This reader returns the data model (schema) of your input as a list.

You can then compare this list to a list of expected attributes, something you can use the ListBasedFeatureMerger transformer for.