Hello
I am generating a json file for photographs metadata.
At the start and end of the file I have an open bracket and a closed bracket. I don't want to have this square brackets in the generated json file.
Thanks
Hello
I am generating a json file for photographs metadata.
At the start and end of the file I have an open bracket and a closed bracket. I don't want to have this square brackets in the generated json file.
Thanks
The square brackets indicate an array of objects, and the FME JSON writer will output them even when there is only a single feature.
The easiest is probably to use the JSONTemplater to generate the JSON contents according to your specification and to write the results using the Text File writer.
Can I position the JsonTemplater before generating the json file or do I have to generate the json file first and then apply the formatting ?
Even though I prefer @david_r answer, another approach would be to use an AttributeTrimmer to remove the leading "o" and trailing "]". I wouldn't suggest a StringReplacer as that could break valid arrays in the JSON