question

anon-user avatar image
0 Likes"
anon-user asked Matthew Gillespie edited

Separating String Data

Hello FlexSim Support Team,

Could you please tell me how I can separate this text data and put it in a global table column wise using Flexscript?For example: ABCD/EFGH/IJKL so I want ABCD in column 1st and EFGH in column 2nd and IJKL in column 3rd.



FlexSim 22.1.0
data slicing
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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie edited

You can use string.split() to split a string into an array using "/" as the delimiter:

string text = "ABCD/EFGH/IJKL";
Array cols = text.split("/");
Table table = Table("GlobalTable1");
for (int i = 1; i <= cols.length; i++)
    table[1][i] = cols[i];
5 |100000

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