Page 1 of 1

inverse of :toarray to create a CSV string

Posted: Thu Oct 13, 2016 4:33 pm
by jeroenp
I posted in the wrong forum before, so I will delete this from "General" soon: http://forum.mikrotik.com/viewtopic.php?f=2&t=113373 as it better fits the Scripting forum:

`:toarray` can be used to split a CSV string into parts as documented at http://wiki.mikrotik.com/wiki/Script_to ... f_the_week

What is the inverse? i.e. how can you convert an array of strings into a CSV string (apart from manually coding a loop)?

--jeroen

Re: inverse of :toarray to create a CSV string

Posted: Mon Oct 31, 2016 1:03 pm
by jeroenp
Bump.

Anyone having a good idea for this (apart from manually assembling the CSV).

--jeroen

Re: inverse of :toarray to create a CSV string

Posted: Mon Oct 31, 2016 1:37 pm
by mrz
[admin@rack1_hexv3_down] /system script> :global aa {"a";"b";"c"}
[admin@rack1_hexv3_down] /system script> :put [:tostr $aa]
a;b;c