I'm not sure if this will help you or not, but this may make your data handling a little easier with INI items, its $readini but with wildcard search compatibility:

; Usage:
; $wreadini(filename, topic, text-pattern, N, format)
;
; the text-pattern parameter can contain wildcard
; characters such as * and ?. As well the N
; parameter can be either 0 or above.
;
; if N is 0 it will return the total matches
;
; Heres an example:
;
; $wreadini(c:\test.ini,mirc,w?il?ca*,1,3)
;
; since N is 1 this would return the 1st matching
; item. w?il?ca* could be any of the following
; matches:
;
; wildcard
; wildcardddddd
; wailscabeww
;
; the format parameter can be one of 3 options:
;
; * can be used alone for the search pattern to return
; all items within a specific section in the ini file.
;
; 0 - value
; 1 - item=value
; 2 - item
; 3+ - value
;
; format can be null and will default to format 3
; Enjoy!

alias wreadini {
var %f = $iif($chr(32) isin $1,$+(",$1,"),$1), %l = 1, %r = 0, %p
if (($0 < 4) || (!$isfile(%f))) { echo $color(info) -q * Invalid parameters: $eval($wreadini,0) | return }
while ($ini(%f,$2,%l)) {
var %x = $ini(%f,$2,%l)
if ($eval($3,2) iswm %x) {
%p = $readini(%f,n,$2,%x)
inc %r
if (($4 != 0) && (%r = $4)) {
if ($5) {
if ($5 = 1) { return $+(%x,=,%p) }
elseif ($5 = 2) { return %x }
else { return %p }
}
else { return %p }
}
}
inc %l
}
if ($4 = 0) { return %r }
}

Hope this helps you in some way... maybe you can modify it to extend its functionality for what your needing smile