There seems to be a bug in CSV_Load
It wont detect the correct number of colums. first it loops the correct amount, then it loops and sets it back to 1, at least with my csv. i corrected it with this.
Code:
CSV_Load(FileName, CSV_Identifier="", Delimiter="`,")
{
Local Row
Local Col
temp := %CSV_Identifier%CSVFile
FileRead, temp, %FileName%
StringReplace, temp, temp, `r`n`r`n, `r`n, all ;Remove all blank lines from the CSV file
loopnumber = 1
Loop, Parse, temp, `n, `r
{
if loopnumber = 1
Col := ReturnDSVArray(A_LoopField, CSV_Identifier . "CSV_Row" . A_Index . "_Col", Delimiter)
loopnumber ++
Row := A_Index
Loop, Parse, A_LoopReadLine, %Delimiter%
{
Col := A_Index
%CSV_Identifier%CSV_Row%Row%_Col%Col% := A_LoopField
}
}
%CSV_Identifier%CSV_TotalRows := Row
%CSV_Identifier%CSV_TotalCols := Col
%CSV_Identifier%CSV_Delimiter := Delimiter
SplitPath, FileName, %CSV_Identifier%CSV_FileName, %CSV_Identifier%CSV_Path
IfNotInString, FileName, `\
{
%CSV_Identifier%CSV_FileName := FileName
%CSV_Identifier%CSV_Path := A_ScriptDir
}
%CSV_Identifier%CSV_FileNamePath := %CSV_Identifier%CSV_Path . "\" . %CSV_Identifier%CSV_FileName
}