#Multi post sting list

1 messages · Page 1 of 1 (latest)

urban lagoon
#

How do i make a macro that get a set of data from a data block. Also called a 2 dimensional array.

I have tried to define the data by
Datablock = {
[data1_1,data1_2,data1_3,data1_4],
[data2_1,data2_2,data2_3,data2_4],
[data3_1,data3_2,data3_3,data3_4] }

And i try to get it with
temp = getlist(Datablock, 2)

meaning i take a copy of the second line of data (set2) and put it in temp.
Then i am supposed to use getlist in another macro to get the single post of data.
But the does not seem to accept the way i make the 2dim list.

What do i do wrong ?

The data i work with has 800 lines with 16 posts in each and i can not give each data a name or split them with json, at least not in a way that i know off
and 800 if lines are a bit too many to work with

urban lagoon
#

thx .. i know that page and i cant find anything about a 2 dimentional array. So can u be more specific

rocky obsidian
#

You need to define your data correctly.```
[H: Datablock = json.append("",
json.append("","data1_1","data1_2","data1_3","data1_4"),
json.append("","data2_1","data2_2","data2_3","data2_4"),
json.append("","data3_1","data3_2","data3_3","data3_4")
)]

[H: temp = json.get(Datablock,2)]```

#

Now, if you're having trouble converting the data you have to json, just post a sample and I can show you how. I also have macros for Notepad++ that can turn a column of values in to a quoted list. I usually use that with excel columns.

urban lagoon
#

Thx alot

dusky hinge
#

Defined like that you should also look at reading it with json.path functions.

rocky obsidian
#

All those helpful array functions just don't work.

dusky hinge
rocky obsidian
#

You can directly reference a field, just can't use in, nin, subsetof, anyof functions because it doesn't see the json array as an array. You can use a literal array and those work, just not by reference.

#

Now if it's a list like "data3_1, data3_2, data3_3, data3_4" then those functions work.