Skip to main content
Solved

How to create a customized writer?

  • November 30, 2017
  • 5 replies
  • 31 views

Forum|alt.badge.img

I need to create a csv-file with a special structure. I 've two problems which I haven't an idea how to solve:

1. How can I add a file-header before the actual content (The yellow part on the picture)?

2. If an element has more than one coordinate pairs (in case of a line) how can I add the vertexes and the end-point on the same row (The part witch is in blue on the picture)?

Yellow: File-header

 

Orange: Column-Header

 

Shades of Blue: Element coordinate(s)

Best answer by takashi

If you create each row including the header as a single text line consisting of required comma separated values, those lines can be written into a file with a Text File writer.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

takashi
Celebrity
  • Best Answer
  • November 30, 2017

If you create each row including the header as a single text line consisting of required comma separated values, those lines can be written into a file with a Text File writer.


Forum|alt.badge.img
  • Author
  • November 30, 2017

If you create each row including the header as a single text line consisting of required comma separated values, those lines can be written into a file with a Text File writer.

I think this could be the solution. I will try it and let you know if it worked. Thank you!

 


fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • November 30, 2017

Hi @nindalf You could even use one workspace to first write the header to a text file and then the data to the same file with a CSV writer. Be sure to append with the CSV and not overwrite.


Forum|alt.badge.img
  • Author
  • December 4, 2017

Hi @nindalf You could even use one workspace to first write the header to a text file and then the data to the same file with a CSV writer. Be sure to append with the CSV and not overwrite.

This is also possible but I think the problem is to write the coordinates of the lines on one row of the csv (the blue part of the example). Am I wrong?

 

 


Forum|alt.badge.img
  • Author
  • December 12, 2017

Could you give me a hint how I can write a text line of feature attributes separated by a semicolon to a text file?