Test.ini:
Code: Select all
[Red]
foo1=bar1
foo2=bar2
[Green]
foo3=bar3
foo4=bar4
Code: Select all
Array := []
Loop
{
FileReadLine, Line, Test.ini, %A_Index%
if ErrorLevel
Break
Matched := RegExMatch(Line, "i)^\[.+\]")
if Matched = 1
Array.Push(A_LoopReadLine)
}
; And next, the goal is to convert this array into "Red|Green" string (or "RedGreen" without vertical bar).
; But I don't understand how to achieve it.
; I also tried to use pseudo-array but it doesn't look simpler for me.