Skip to main content
Solved

create custom text file


I need to output an SQL script created with SQL Creator in a custom text file. The file is essentially a csv file but with '|' as the seperator, the header row prefixed with a 'H|' the rows of data prefixed with 'B|' and a footer containing F|<file_id>|<datetime_stamp>|<number_of_rows>

creating a csv file using '|' is easy enough but I haven't found a way to do the prefixes or footer. I was looking at using XML Templater but not sure if I'm barking up the wrong tree.

 

Any guidance would be greatly appreciated.

Best answer by takashi

Another thought. Create a CSV file without footer line using the FeatureWrite (Format: CSV), then create and append footer line to the file aftterward.

View original
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.

2 replies

jdh
Contributor
Forum|alt.badge.img+41
  • Contributor
  • June 11, 2018

I would be tempted to use a Creator and AttributeCreators, along with a StatisticsCalculator or Aggregator to get the Feature count and send them all to a text writer.

 

 

 


takashi
Celebrity
  • Best Answer
  • June 11, 2018

Another thought. Create a CSV file without footer line using the FeatureWrite (Format: CSV), then create and append footer line to the file aftterward.