Skip to main content
Question

Excel Writer with a template: conserve columns positions like the template


quelozantonin
Contributor

Hi,

 

I'm trying to write an XLS file based on a template (according to this help), with complete rewriting of the data (Overwrite Existing File = Yes) and I can't find a way to keep the order of the columns according to the template in the output XLS and not in the order in which FME processes the attributes. For example, I would like that if I invert 2 columns in the template, it also inverts it in the output xls, without setting this with an attribute manager.

 

Did I miss a parameter in the xls output that would allow this or is there another method.

Thanks a lot in advance for your answers and best regards.

 

Antonin

3 replies

ctredinnick
Supporter
Forum|alt.badge.img+18
  • Supporter
  • April 28, 2023

I'm not sure it'll work exactly like that. If you set Output Field Names to No (maybe also Start Row = 2), then the column names in the template will be used as-is, but the column ordering will be as per the Writer in FME. So actions like reordering the column positions in the template, or adding another column in the writer will break the alignment between the two.

Maybe someone can correct, but I don't think it detects where column names are before writing, rather it just writes out according to the writer, and the use of the template in some ways just controls what features of the template are not overwritten in the process.


quelozantonin
Contributor

Thanks a lot for your answer.

But in case of you choose to insert (so complete an existing file with other data), the system must detect in which columns the previous attributes have been inserted, to keep a coherence? I don't understand why it couldn't be the same if you choose to update with etablish column!?


matthewb
Contributor
Forum|alt.badge.img+9
  • Contributor
  • January 22, 2024

Were you able to figure this out? I'm looking for the same answer.


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