:local fn "text.txt"
:local content [/file get $fn contents]
:local datalen [:len $content]
:local fi 0
:local idx 0
:local res [:toarray ""]
:put $datalen
do {
:local cr [:find $content "\n" $fi]
if ([:typeof $cr] = "nil") do={
:set cr $datalen
}
:put "fi: $fi, cr: $cr, idx: $idx"
:local line [:pick $content $fi $cr]
:put $line
:if ( [:len $line ] > 0 ) do={ /ip firewall address-list add list=Test address=$line }
:set ($res->$idx) $line
:set fi ($cr + 1)
:set idx ($idx + 1)
} while ($fi <= $datalen)
:return $res