Skip to main content
Solved

Reading XLSX Files


Forum|alt.badge.img

I'm a newer FME user. I have set up a workflow to read an xlsx file and write out as a csv, however it seems that it only likes reading the first file that i ran it with and does not work with any other file. I've set a user defined parameter to read files contained within a folder. I'm not sure what else i need to configure.

Best answer by takashi

The worksheet names (feature type names) in the two Excel files are different, whereas the FeatureReader is configured to read the feature type called "2019 Q1 - Raw Data". That's the direct reason why the FeatureReader reads only the first worksheet, whose name matches the specified feature type.

If you need to read multiple worksheets with different names (with the same schema), set "Single Output Port" and configure "Attributes to Expose" in the FeatureReader.

Alternatively, in your case, it could be easier to use the regular Excel reader with the Single Merged Feature Type option, rather than the FeatureReader.

View original
Did this help you find an answer to your question?

5 replies

Forum|alt.badge.img
  • Author
  • July 2, 2019

Here are the example files and workflow. I also attached a "batch" fmw file. The "panel to csv" only works for the "2019 Q1-Raw Data.xlsx"

 

2019 Q1 - Raw Data.xlsx2019 Q2 - Raw Data.xlsxPanel to CSV.fmwBATCH UPLOADER - Panel to CSV.fmw


andreaatsafe
Safer
Forum|alt.badge.img+10

Hi @lucasghd,

When first adding in the Excel reader, you will want to set the Additional File Setting to "Use Current Settings"

This is assuming that after you set up the columns and data to read in the reader parameter, that the rest of the files have this same schema.

You will then be able to process and read new Excel files with the same schema/data structure.

 

Hope this helps!

-Andrea


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • July 2, 2019

The worksheet names (feature type names) in the two Excel files are different, whereas the FeatureReader is configured to read the feature type called "2019 Q1 - Raw Data". That's the direct reason why the FeatureReader reads only the first worksheet, whose name matches the specified feature type.

If you need to read multiple worksheets with different names (with the same schema), set "Single Output Port" and configure "Attributes to Expose" in the FeatureReader.

Alternatively, in your case, it could be easier to use the regular Excel reader with the Single Merged Feature Type option, rather than the FeatureReader.


Forum|alt.badge.img
  • Author
  • July 3, 2019
andreaatsafe wrote:

Hi @lucasghd,

When first adding in the Excel reader, you will want to set the Additional File Setting to "Use Current Settings"

This is assuming that after you set up the columns and data to read in the reader parameter, that the rest of the files have this same schema.

You will then be able to process and read new Excel files with the same schema/data structure.

 

Hope this helps!

-Andrea

Thank you Andrea, this worked!

Forum|alt.badge.img
  • Author
  • July 3, 2019
takashi wrote:

The worksheet names (feature type names) in the two Excel files are different, whereas the FeatureReader is configured to read the feature type called "2019 Q1 - Raw Data". That's the direct reason why the FeatureReader reads only the first worksheet, whose name matches the specified feature type.

If you need to read multiple worksheets with different names (with the same schema), set "Single Output Port" and configure "Attributes to Expose" in the FeatureReader.

Alternatively, in your case, it could be easier to use the regular Excel reader with the Single Merged Feature Type option, rather than the FeatureReader.

thank you Takashi!


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