Community discussions

MikroTik App

Do you want this to be fixed as well?

Yes
2 (100%)
No
No votes
 
Total votes: 2
 
ncabral
just joined
Topic Author
Posts: 1
Joined: Thu Sep 02, 2021 9:13 pm

Semi-Colon used to Delimitate Fields Inside of Fields also Delimitated by Semi-Colons

Thu Sep 02, 2021 9:41 pm

I am uncertain as to whether or not this is a bug or if this is by design.

I use the command ":put [/path print as-value]" to print table data in the terminal.

I do this because I can easily copy and paste the data into a text file and the data is easy to parse into a csv file using a python script.

I noticed however when I entered ":put [/routing stats origin print as-value]", the output contains a field called "route-count" which contains a list of values. Each value in the list is parsed using a semi colon.

Here is one row of data from the table in the output.
Example: ".id=*20040018;instance-id=4294967295;name=Connected route;owner=1;publisher-idx=0;route-count=0;6;6;0;0;0;0;0;0;0;0;0;0;route-type=2;total-route-count=12;"

Notice that each individual field is parsed using a semi-colon, and so is the route-count field's data.

I understand that semi-colons are used to delimitate each field in an array in Router OS BUT, why would the array data in a field not be delimitated by double quotes or something to indicate that it is separate from the surrounding data?
For example: ".id=*20040018;instance-id=4294967295;name=Connected route;owner=1;publisher-idx=0;route-count="0;6;6;0;0;0;0;0;0;0;0;0;0";route-type=2;total-route-count=12;"

I have the ability to work around this issue, but it is incredibly frustrating. Is there any possibility that this can be fixed or changed? Can lists within fields be delimited by another character to separate them from the surrounding data structure?

Who is online

Users browsing this forum: No registered users and 24 guests