How do I go around converting a tab-separated text tree like this:
a
a1
a3
a2
into a JSON format tree like this:
[
{
"name":"a",
"children":[
{
"name":"a1",
"children":[
{
"name":"a3",
"children":[]
}
]
},
{
"name":"a2"
"children":[]
}
]
}
]
in javascript? I think that you get the idea, I want a tab \t separated tree structure to be converted into a JSON tree structure. Thanks!