Skip to main content
Question

verify file header


maica
Contributor
Forum|alt.badge.img+1
  • Contributor

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

4 replies

itay
Supporter
Forum|alt.badge.img+17
  • 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
itay wrote:

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+17
  • Supporter
  • April 7, 2020
maica wrote:

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings