Using two arrays, process the text and create a third array

@DyadyaGenya
If you still have troubles with parsing PDU, here is mine script if you find it useful:
sms-read.rsc (33.7 KB)
and sms2email script which is using it:
sms2email.rsc (1.31 KB)
sms-read script is mostly created from scripts at http://forum.mikrotik.com/t/script-for-sending-incoming-sms-to-mail-with-full-parsing/140125/1 with some mine modifications and code formatting.