alias smoothini {
var %i = 1
while $ini(ini.ini,$1,%i) {
if $ini(ini.ini,$1,%i) != %i {
[color:green]; Find the line number by $read()/$readn, first to find the section, then the item
; this also serves to grab the info :)[/color]
var %a = $read(ini.ini,w,$+([,$1,])),%b = $read(ini.ini,nw,$ifmatch $+ =*,$readn)
[color:green]; Insert the new line into the original position[/color]
write -il $+ $readn ini.ini $+(%i,=,$gettok(%b,2,61))
remini ini.ini $1 $ifmatch
}
inc %i
}
}