Skip to main content
Question

Convert text to JSON


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?

5 replies

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

Have a look at the JSONTemplater and JSONValidator transformers.

Hope that helps solving your puzzle.


takashi
Influencer
  • 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+13
  • Supporter
  • May 30, 2017
Hi @mjvoorwinden, may I

 

know where is the data originated from?

 

Thanks.

 

Lyes

 


mygis wrote:
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+13
  • Supporter
  • May 30, 2017
mjvoorwinden wrote:
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.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings