extracting numbers from strings

I get

-54dBm@48Mbps
-68dBm@6Mbps
-72dBm@6Mbps
-76dBm@6Mbps
-88dBm@6Mbps
-69dBm@18Mbps
-63dBm@48Mbps
-69dBm@6Mbps

from script

interface wireless registration-table {:foreach i in=[f] do={:set sig [g $i sig]; :put  $sig }}

and I want only numbers (-54,-68,..) instead of strings so I can compare them later.

Tnx for any advice.

easy!

:local numSig :tonum [:pick $sig 0 3]

And :tonum export or print to a file in Mikrotik FTP?

# create test.txt file
/file print file=test ;
# write content to file
/file set [/file find name=test.txt ] contents="any content you want" ;

#to check that content was written to file
:put [/file get [/file find name=test.txt ] contents ] ;

/file not set :frowning:

looks like /file set is available only in v3 beta

:frowning: :frowning: :frowning:

do you really need to have the content in a file? Maybe the global variable is enough ? You can access it from other scripts but you cannot access it by FTP..

If you need to report some values to another device (central logger) you can configure log system to send some events to remote Ssyslog sever and ‘export’ the values from script thtough the log system (:log info “blabbla”)