Skip to main content
Question

Compare two separate excel files and report on matched and unmatched column name

  • May 3, 2019
  • 6 replies
  • 166 views

Forum|alt.badge.img

I have several excel files(from customer) which needs to be validated with source/master excel files which have the appropriate/correct column names - how can we match the excel file(from customer) column names with source/master excel file and report on matched and unmatched(incorrect) column names

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.

6 replies

danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • May 3, 2019

Hi @mackmk

First - The Xls Reader ( master ) insert on Workbench, but after choose the Parameters -> Field Names Row = 0:

And expose the format Attribute from xls file = xlsx_row_id.

Use the transformer Tester to filter just the Line 1. If you check the Output Port Passed ( after Run ) you can see the values from Attributes A and B.

Second - Input the files from your customer with the same operation above ( that I described ) and use a transformer to compare these values, for example FeatureMerger.

 

If you need more some help, don't hesitate to describe here.

 

Thanks,

Danilo

 


Forum|alt.badge.img
  • Author
  • 6 replies
  • May 3, 2019

Hi @mackmk

First - The Xls Reader ( master ) insert on Workbench, but after choose the Parameters -> Field Names Row = 0:

And expose the format Attribute from xls file = xlsx_row_id.

Use the transformer Tester to filter just the Line 1. If you check the Output Port Passed ( after Run ) you can see the values from Attributes A and B.

Second - Input the files from your customer with the same operation above ( that I described ) and use a transformer to compare these values, for example FeatureMerger.

 

If you need more some help, don't hesitate to describe here.

 

Thanks,

Danilo

 

Hi Danilo - Thanks for your response.

How should I use FeatureMerger - if I use a form id/any column as a joiner(join on) - it would merge all the features...

Thanks,

Mak


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • May 3, 2019

Hi Danilo - Thanks for your response.

How should I use FeatureMerger - if I use a form id/any column as a joiner(join on) - it would merge all the features...

Thanks,

Mak

Hi @mackmk

You can use with concatenation attributes:

 

Thanks,

Danilo

 


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • May 3, 2019

I would use the Schema Reader, instead of an Excel reader.

The Schema reader only passes the column names to the workspace, not the data.

Then compare the schema's using the ChangeDetector transformer, to see if the schema's match.


Forum|alt.badge.img
  • Author
  • 6 replies
  • May 7, 2019

@danilo_fme, @erik_jan Thanks for your replies. I have tried the suggested options but did not get the desired results - not sure if I have set it up right... I have attached the two excel files containing the column names - could you please assist with the workflow?Table1_SourceFile.xlsxTable2_ComparisonFile.xlsx


Forum|alt.badge.img
  • Author
  • 6 replies
  • May 7, 2019

@danilo_fme, @erik_jan - I think I got it working -this is how it looks now(re snapshot) - used the schema reader, listExploder & FeatureMerger to get the desired outcome - Thanks heaps for your help.