How to save ugly (no properties) JSON to table ?

cherubin

Client
Регистрация
06.06.2016
Сообщения
92
Благодарностей
6
Баллы
8
Hi,

I have a JSON, provided by an API that i don't manage, like this :

Код:
{
"status":"ok","query":"big keyword","content":"my text query to analyse according to query",
"lang":"fr_fr",
"blue":[["Keywords 1",5.0698141096857,5.1469482471082],["Keywords 2",4.9287355114258,"0.50031072108822885E1"],["Keywords 3",2.4929673359518,"0.36477597387294596E1"]],
"green":[["Keywords 1",5.1469482471082,5.1855153158194],["Keywords 2","0.50031072108822885E1",5.0402930606105],["Keywords 3","0.36477597387294596E1",3.9633714776842]],
"orange":[["Keywords 1",5.1855153158194,5.2240823845307],["Keywords 2",5.0402930606105,5.0774789103388],["Keywords 3",3.9633714776842,4.2789832166389]],
"red":[["Keywords 1",5.2240823845307,6.2240823845307],["Keywords 2",5.0774789103388,6.0774789103388],["Keywords 3",4.2789832166389,5.2789832166389]],
"scores":[["Keywords 1",0],["Keywords 2",0],["Keywords 3",4.6670520510694]],
"score":34,"danger":4
}
And what i would like to have in my table is :

blue (property)
line1
A : Keywords 1
B : 5.0698141096857
C : 5.1469482471082
line2
A : Keywords 2
B : 4.9287355114258
C : 0.50031072108822885E1

Etc.

As you can see, there isn't any other subproperty correctly named, so zenno find and add them like :

blue[0][0] = Keywords 1
blue[0][1] = 5.0698141096857
blue[0][2] = 5.1469482471082

However i cannot add to table without named property.

So how can i do what i want ?

Thanks
 

zortexx

Client
Регистрация
19.09.2011
Сообщения
2 520
Благодарностей
1 223
Баллы
113

cherubin

Client
Регистрация
06.06.2016
Сообщения
92
Благодарностей
6
Баллы
8
Yes, that's what i dit in the first place, but then, i don't know how to select all of the variables and put them in a table.
Because variable processing offer to manage only one by one variable.

So how do you do if you want to put all the "blue" items in a table?

blue[0][0] = Keywords 1
blue[0][1] = 5.0698141096857
blue[0][2] = 5.1469482471082

blue[1[0] = Keywords 2
blue[1][1] = 4.9287355114258
blue[1][2] = 0.50031072108822885E1
 

cherubin

Client
Регистрация
06.06.2016
Сообщения
92
Благодарностей
6
Баллы
8
I almost find a solution to organize the data, however i have an issue in order to round the numbers.

I tried the own javascript module with this :

Код:
var min = {-Variable.JS_Test-};
min.toFixed(3);
But it's not working, so how can i do ?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)