Skip to main content
Solved

Generic featurereader: how to keep columns A, B, C in an excel file by setting a parameter in the dataset


zizou84
Contributor
Forum|alt.badge.img+1

Hello,

We have an excel file with different first lines.
For this reason, we have defined the featurereader in the excel file, which allows us to have the column names in A, B, C ... and not the column name with the values of the first line.

This works very well, but as soon as we put a parameter in the dataset (instead of a hard-coded directory path), we lose the A, B, C field names and can't use them generically.

do you think there's a solution for keeping column names in A, B, C?

Best regards

Best answer by nielsgerrits

When I need this, I use the “Generic (Any Format)” reader. This will not return A,B,C but col_1,col_2,col_3. Sample attached.

 

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

10 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • September 24, 2024

When I need this, I use the “Generic (Any Format)” reader. This will not return A,B,C but col_1,col_2,col_3. Sample attached.

 


zizou84
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 24, 2024

Thanks Niels, I can't download your attachment, as soon as I can I'll have a look with pleasure.


nielsgerrits
VIP
Forum|alt.badge.img+54

 


zizou84
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 25, 2024

Hi Niels, 

it works well !

I searched for a while to find the format “generic(any format)”. I've never used it before :)

I get the col_1 col_2 etc columns and I can filter on xlsx_row_id to take into account only the data and not the header.
the only problem I have is that I have two tabs in my excel files and I only want to retrieve data from one tab and I haven't found a way to retrieve the tab name and filter it …

I can't get the tab name by doing an attribute_expose


zizou84
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 25, 2024

Sorry, I found the name of the tab with the fme_feature_type !
so all's well!

 

Thank you again Niels !


nielsgerrits
VIP
Forum|alt.badge.img+54
zizou84 wrote:

Hi Niels, 

it works well !

I searched for a while to find the format “generic(any format)”. I've never used it before :)

I get the col_1 col_2 etc columns and I can filter on xlsx_row_id to take into account only the data and not the header.
the only problem I have is that I have two tabs in my excel files and I only want to retrieve data from one tab and I haven't found a way to retrieve the tab name and filter it …

I can't get the tab name by doing an attribute_expose

Ah yes, unexposed attributes. I always open my results in a different window (Data Inspector) where the feature information panel is always visible. You can try this by closing the visual preview and change something in the settings. I believe the visual preview window is limiting most users because of this.

  

zizou84 wrote:

Sorry, I found the name of the tab with the fme_feature_type !
so all's well!

 

Thank you again Niels !

Happy I could help :)


nielsgerrits
VIP
Forum|alt.badge.img+54
zizou84 wrote:

Thanks Niels, I can't download your attachment, as soon as I can I'll have a look with pleasure.

@danielleatsafe for this post also, something seems off with the attachment. Personally I think the attachments with working samples are the key to get new users up and running. To have something which just works and can be changed to your needs.


zizou84
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 25, 2024

thanks for the tip on unexposed attributes


danielleatsafe
Safer
Forum|alt.badge.img+18
nielsgerrits wrote:
zizou84 wrote:

Thanks Niels, I can't download your attachment, as soon as I can I'll have a look with pleasure.

@danielleatsafe for this post also, something seems off with the attachment. Personally I think the attachments with working samples are the key to get new users up and running. To have something which just works and can be changed to your needs.

The attachments issue should be fixed now!


nielsgerrits
VIP
Forum|alt.badge.img+54
danielleatsafe wrote:
nielsgerrits wrote:
zizou84 wrote:

 

@danielleatsafe for this post also, something seems off with the attachment. Personally I think the attachments with working samples are the key to get new users up and running. To have something which just works and can be changed to your needs.

The attachments issue should be fixed now!

Great, thanks, works for me :)


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