Autohotkey 将数组中的字符串拆分为数组自动热键

Autohotkey 将数组中的字符串拆分为数组自动热键,autohotkey,Autohotkey,尝试以自动热键读取CSV文件,并逐行按“,”拆分,以拉出每行的最后两列。当前正在尝试将字符串拆分为数组。我可以用这行打印每一行 MsgBox,一个_LoopReadLine,但无法在变量内部拆分字符串 我尝试过StringSplit和StrSplit,但我确信语法不正确 MyArray := Object() Loop, read, %fileop% { MyArray.Insert(A_LoopReadLine) ; Append this line to the array.

尝试以自动热键读取CSV文件,并逐行按“,”拆分,以拉出每行的最后两列。当前正在尝试将字符串拆分为数组。我可以用这行打印每一行
MsgBox,一个_LoopReadLine
,但无法在变量内部拆分字符串

我尝试过StringSplit和StrSplit,但我确信语法不正确

MyArray := Object()
Loop, read, %fileop%
{
    MyArray.Insert(A_LoopReadLine) ; Append this line to the array.
    index := 1
    MsgBox, %A_LoopReadLine%
    ;MyArray.
    ;MsgBox, % StrSplit(A_LoopReadLine ,",")
}

Loop % MyArray.Length()
    MsgBox % StrSplit(MyArray[A_Index],",")
尝试以自动热键读取CSV文件并逐行拆分 逐行“,”以拉出每行的最后两列

这将以
MyArray[行][列]
格式存储csv文件。例如,要访问第五行的第二项:
MyArray[5][2]

for k,v in MyArray
    v.RemoveAt(1,v.Length()-2)
上述操作将从每行中删除除最后两项以外的所有项目


文件:


编辑: 以及为什么你的代码不起作用。有点像。 问题是
StrSplit()
返回对象数组,所以在下面的行中,您试图在MsgBox中显示对象,这是不允许的

MsgBox % StrSplit(MyArray[A_Index],",")
例如,这将起作用:

MsgBox % StrSplit(MyArray[A_Index],",")[1]
相关的:
MsgBox % StrSplit(MyArray[A_Index],",")[1]