Skip to main content

Hello,

i need to process excel files, currently by means of FME Form 2023.1, perspectively using FME Flow. These files, however, can differ in columns available. See attachments. The files are processed individually, only one file at a time.

If i run the process with file “tk_template_v0.0.xlsx” I want the featurereader to display only the columns, containing in this file. If I run “tk_template_v0.1.xlsx”, which has got 3 more columns, i want these columns to be available in the process as well.

I would like to run the script with these files without clicking on the “Feature Types to Read” button any time I process a new file! The sheet name always have the name “Tabelle1”.

Unfortunately  I do not find a set of parameter that results in the desired output.

The existing posts have not yet enlighten me!

 

Any ideas?

 

 

 

 

Why don’t you use two different FeatureReader?

 


See the Excel Reader help for Parameters

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-ReadersWriters/xlsx/XLSX_reader.htm

In the FeatureReader Excel Reader format Parameters, you can Turn On “Scan Schema in Dynamic Workflow”. This will read however many extra Excel columns exist that do not have missing or Null data.

 

If the extra Attributes need to also be exposed to the Workspace, then can use an AttributeExposer to ensure that they are exposed:

  • If no Field exists then all of the Features coming out of the AttributeExposer extra Attributes will having Missing Values, and this can be tested in the workspace with Eg. Tester and/or DuplicateFilter if all rows the Attribute is Missing = Field does not exist in the source Worksheet
  • If the Field does exist then at least one of the Features coming out of the AttributeExposer extra Attributes will have a value

 

 


Hi @philippeb,

Thanks for your support! I don’t know beforehand what the Excel files look like with respect to the columns. The two attachments where just two examples.


Hi @bwn,

thanks for your reply. IU am using FME 2023.1. In this version the option “Scan Schema in Dynamic Workflow” is not available!

In the FME documentation Microsoft Excel (XLSXR) Reader Parameters (safe.com) this option isn’t mentioned neither. Do I oversee something?

 


Hi @bwn,

thanks for your reply. IU am using FME 2023.1. In this version the option “Scan Schema in Dynamic Workflow” is not available!

In the FME documentation Microsoft Excel (XLSXR) Reader Parameters (safe.com) this option isn’t mentioned neither. Do I oversee something?

 

 

Hmmm.  No, haven’t missed something.  It appears Safe moved the functionality to somewhere else in later versions of FME.

It might be in FME 2024 the Reader is now automatically dynamically reading the rows and all Fields that have a Field Name in the Field Row, and instead the Parameters have just been simplified to choosing which Attributes to expose to the workspace rather than previously where by Default the Exposed Attribute selection also set which Fields were read.

If you change an example Excel file and add a new Column to it in Excel, and add some values in that column:  Running the Reader again, does this new Column now show as an unexposed Attribute in the Feature Information window of Data Inspector?  Eg. Feature Information window below…

 



 

 


Reply