Skip to main content

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)

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.


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!

 


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.


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?

 

 


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


Reply