Skip to main content
Question

Convert text to JSON

  • May 29, 2017
  • 5 replies
  • 328 views

Having the input txt file , how can I easily convert this into JSON? Each indented line is a new array in JSON. It should look like .

Any suggestions how to do this?

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

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • May 29, 2017

Have a look at the JSONTemplater and JSONValidator transformers.

Hope that helps solving your puzzle.


takashi
Celebrity
  • May 30, 2017

Hi @mjvoorwinden, as @erik_jan suggested, you can use the JSONTemplater to generate a JSON document, but it could be necessary a bit complex procedure to construct nested structure according to indentations of the text lines in this case. I think the attached workspace example provides some tips to achieve the goal: textline2none.fmwt (FME 2017.0)


mygis
Supporter
Forum|alt.badge.img+14
  • Supporter
  • May 30, 2017
Hi @mjvoorwinden, may I

 

know where is the data originated from?

 

Thanks.

 

Lyes

 


Hi @mjvoorwinden, may I

 

know where is the data originated from?

 

Thanks.

 

Lyes

 

Hi @gisinnovationsb, the data originates from a German standard, called VDI. See for full examples VDI Portal.

 

 


mygis
Supporter
Forum|alt.badge.img+14
  • Supporter
  • May 30, 2017
Hi @gisinnovationsb, the data originates from a German standard, called VDI. See for full examples VDI Portal.

 

 

Hi @mjvoorwinden ,

 

I believe you need to know the VDI format pretty well before embarking into converting the files into Json . From what I understand it is a BIM format. If you can convert to and intermediary format then you might be able to proceed with the conversion to Json.