question

Jouky D avatar image
0 Likes"
Jouky D asked Felix Möhlmann commented

Exporting and Importing csv with object and Array Columns.

Hello everyone,


I tried to export to a csv file a table with different column types: strings, integers, doubles, OBJECTS, ARRAYS of arrays, etc. All the columns are exported fine except the objects and the arrays of arrays.


I want to re-import that table into FlexSim again to avoid calculate the table again after the reset. But the values are imported as string, e.g.

array: Array[8]: {Array[2]: {1.000000, 4.000000}, Array[2]: {1.000000, 4.000000}, Array[2]: {1.000000, 4.000000}, Array[2]: {1.000000, 4.000000}, Array[2]: {1.000000, 4.000000}, Array[2]: {1.000000, 4.000000}, Array[2]: {1.000000, 4.000000}, Array[2]: {1.000000, 4.000000}}


Is there a way to export and import correctly? If not, maybe I could save the table on a specific moment to reset the table on that values?


Thank you:)

FlexSim 23.2.1
excel importtablesarray
· 8
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jouky D avatar image
0 Likes"
Jouky D answered Felix Möhlmann commented

@Felix Möhlmann and @Joerg Vogel solved it! Thank you! (I don't know why, I can't accept your responses). I used:

- Exporting the Table:

string filename = modeldir().replace("/","\\",1) + "SlotsNode.fsx";

treenode node = Table("Slots");

cmdsavetree(node, filename);


- Importing the Table:

cmdloadtree(node, filename);


It is useful if you table is large. Importing a treenode takes around 6-7 seconds. So if your time computing the table is larger than that, it is useful to apply it. If not, don't waste your time or try another way.

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.