ssh command

I am interacting with RouterOS via ssh with the following command: /ip hotspot user print detail
and I get the following result:

Flags: * - default, X - disabled, D - dynamic
 0 * ;;; counters and limits for trial users
     name="default-trial" uptime=0s bytes-in=0 bytes-out=0 packets-in=0
     packets-out=0

 1   ;;; sample comment
     name="user1" profile=default uptime=0s bytes-in=0 bytes-out=0
     packets-in=0 packets-out=0

 2 X name="user2" profile=default uptime=0s bytes-in=0 bytes-out=0 packets-in=0
     packets-out=0

What I want to know is if there is a way for that result to be an array or a json object or at least the comment field does not appear as ;;; and that it comes out like the other fields, comment=“sample comment”
Any suggestion is welcome

pretty easy using rest-api

$ curl -s -k -u ${USERNAME}:${PASSWORD} -X POST http://192.168.1.1/rest/ip/hotspot/user/print -H "content-type: application/json"  | jq
[
  {
    ".id": "*0",
    "bytes-in": "0",
    "bytes-out": "0",
    "comment": "counters and limits for trial users",
    "default": "true",
    "disabled": "false",
    "dynamic": "false",
    "name": "default-trial",
    "packets-in": "0",
    "packets-out": "0",
    "uptime": "0s"
  }
]

if you have to go directly from ssh you could try

> :put [:serialize to=json  [ /ip/hotspot/user/print as-value]]
[{".id":"*0","comment":"counters and limits for trial users","name":"default-trial","uptime":"1970-01-01 00:00:00"}]

not very pretty though

pretty version

> :put [:serialize to=json options=json.pretty [/ip/hotspot/user/print detail as-value]]
[
    {
        ".id": "*0",
        "bytes-in": 0,
        "bytes-out": 0,
        "comment": "counters and limits for trial users",
        "name": "default-trial",
        "packets-in": 0,
        "packets-out": 0,
        "uptime": "1970-01-01 00:00:00"
    }
]

Couple more options

# semicolon separated
>  :put  [ /ip/hotspot/user/print as-value]
.id=*0;comment=counters and limits for trial users;name=default-trial;uptime=00:00:00
# comma separated with header line csv style
 > :put [:serialize to=dsv options=dsv.remap delimiter="," [ /ip/hotspot/user/print as-value]]
.id,comment,name,uptime
*0,counters and limits for trial users,default-trial,00:00:00

Thank you, it was very helpful