Skip to main content
Question

verify file header

  • April 7, 2020
  • 4 replies
  • 101 views

maica
Contributor
Forum|alt.badge.img+1

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+18
  • Supporter
  • April 7, 2020

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+1
  • Author
  • Contributor
  • April 7, 2020

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
  • April 7, 2020

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+18
  • Supporter
  • April 7, 2020

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.