Skip to main content
Solved

Add a specific text as header and footer of text file


arash_hokm
Contributor
Forum|alt.badge.img+8

Hello FME Community,

 

I am using a 'StringConcatenator' and a 'Text Writer' to create a text file. I intend to add two separate texts as the header and footer.

 

Is there a way to add these texts without duplication?

 

Best answer by nielsgerrits

One way to do this:

  • Sampler to get a single line feature from the data features and use this feature to create the header and the footer features.
  • AttributeCreators on the header, data and footer streams with an attribute "order" with the values 1, 2 or 3.
  • Sorter to sort on the attribute order.
  • Connect to the writer.
View original
Did this help you find an answer to your question?

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+53
  • Best Answer
  • October 11, 2023

One way to do this:

  • Sampler to get a single line feature from the data features and use this feature to create the header and the footer features.
  • AttributeCreators on the header, data and footer streams with an attribute "order" with the values 1, 2 or 3.
  • Sorter to sort on the attribute order.
  • Connect to the writer.

arash_hokm
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • October 11, 2023
nielsgerrits wrote:

One way to do this:

  • Sampler to get a single line feature from the data features and use this feature to create the header and the footer features.
  • AttributeCreators on the header, data and footer streams with an attribute "order" with the values 1, 2 or 3.
  • Sorter to sort on the attribute order.
  • Connect to the writer.

@nielsgerrits​ Thank you very much.

It worked.


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