Page 1 of 1

print comment of hotspot users in certain profile

Posted: Tue Mar 01, 2011 11:24 am
by namo
I want to print a list of hotspot users comments from certain profile

I have the code:
/ip hotspot user print where profile="0300kbps" or profile="0600kbps" or profile="0750kbps" or profile="0900kbps" or profile="1200kbps"
but this print many columns. I want just to print the comments

Re: print comment of hotspot users in certain profile

Posted: Tue Mar 01, 2011 7:28 pm
by fewi
You can't use print for that. Print prints lists of items, with all their properties. You have to find the items, extract the properties you want, and put them.
:foreach ITEM in=[/ip hotspot user find profile="0300kbps" or profile="0600kbps" or profile="0750kbps" or profile="0900kbps" or profile="1200kbps"] do={
  :local COMMENT [/ip hotpost user get $ITEM comment];
  :put "$COMMENT";
}

Re: print comment of hotspot users in certain profile

Posted: Thu Mar 03, 2011 11:49 am
by namo
You can't use print for that. Print prints lists of items, with all their properties. You have to find the items, extract the properties you want, and put them.
:foreach ITEM in=[/ip hotspot user find profile="0300kbps" or profile="0600kbps" or profile="0750kbps" or profile="0900kbps" or profile="1200kbps"] do={
  :local COMMENT [/ip hotpost user get $ITEM comment];
  :put "$COMMENT";
}
there is error in the word hotspot in line 2

I didn't get result. I using characters from other language

they appear correctly in Winbox but they don't in the new terminal