And you don't need to know (in advance).
Like I said count the columns before you create the Listview gui
The answer is in the links I provided earlier, really I know because I put them there
But you wanted to know so here goes
Code:
csvFile=
(join`r`n
1,2,3,a,b,c
4,5,6,d,e,f
)
Loop, Parse, csvFile, `n, `r ; parse each line
{
Row:=A_Index
Loop, Parse, A_LoopField, CSV ; now parse each value
{
Col_%Row%_%A_Index%:=A_LoopField
MaxCol:=A_Index ; yes pretty useless but bare with me you don't want to seem to use the libraries
}
}
Loop, % MaxCol ; yay here it is
Header .= "c" A_Index "|" ; c is just something you can use anything you like
StringTrimRight, header, header, 1
Gui, Add, ListView, w1000 r50 vdisplayLocation,%header%
Loop, % Row ; from above
{
PutRow:=A_Index
Loop, % MaxCol
{
Lv_Add("")
LV_Modify(PutRow, "Col" . A_Index, Col_%PutRow%_%A_Index%)
}
}
Gui, Add, Button, w60, Close
Gui, Show
return
GuiClose:
ButtonClose:
ExitApp
Using one of the libraries will simplify your life but you probably don't want that
