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

Userlevel 2
Badge +12

Have a look at the JSONTemplater and JSONValidator transformers.

Hope that helps solving your puzzle.

Userlevel 2
Badge +17

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)

Badge +2
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.

 

 

Badge +2
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.

 

 

Reply