Hi,
I have plain text as data, the data involves questions and answers. This can be think as key/value. and I want to parse this plain text into JSON. Do you know how I can do this in make? I can do it in javascript.
My plain text data is only a question and answer flow like this;
Question: Answer
Question: Answer
Hi @onurbolaca,
Not sure about how your desired output JSON looks like, but the simplest way you can do is using iterator and text aggregator.
- Setup Iterator that will split the plain text you are getting using newline
- Setup the Text Aggregrator, that will split the result using colon as the seperator.
β{{trim(first(split(2.value; β:β)))}}β : β{{trim(last(split(2.value; β:β)))}}β
This implementation has few issues, also add a filter in between iterator and aggregator to check if the text is empty.
2 Likes
Hello again @onurbolaca
Any luck putting @Runcornβs proposed flow to work? Did it maybe help you accomplish what youβre been trying to do?
Weβre eager to hear how things are coming together and would love an update on your progress
This approached worked for me and helped me a lot.
I parsed as key and value with the static structure of my text.
It became something like this: