本帖最后由 志艺风云 于 2018-9-7 16:37 编辑
你的需求就是这个,一维比二维更简单。
#include <Array.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
Dim $shuzu1[9] = ["张三", "王五", "小牛", "麻子", "小明", "李白", "李四", "小红", "小蒋"]
Dim $shuzu2[9] = ["11.txt", "22.txt", "33.txt", "44.txt", "55.txt", "66.txt", "77.txt", "88.txt", "99.txt"]
_ArrayDisplay($shuzu1, "数组1")
_ArrayDisplay($shuzu2, "数组2")
For $i = 0 To UBound($shuzu1) - 1
DirCreate( @ScriptDir & "\" & $shuzu1[$i])
FileMove($shuzu2[$i], @ScriptDir & "\" & $shuzu1[$i])
Next
可能你实际上是想要这样?
#include <Array.au3>
Dim $shuzu1[4] = ["张三", "王五", "小牛", "麻子"]
Dim $shuzu2[4][3] = [["1.txt", "2.txt", "3.txt"], ["4.txt", "5.txt", "6.txt"], ["7.txt", "8.txt", "9.txt"], ["10.txt", "11.txt"]] ;每个目录下有多个文件
_ArrayDisplay($shuzu1, "数组1")
_ArrayDisplay($shuzu2, "数组2")
For $i = 0 To UBound($shuzu1) - 1
DirCreate(@ScriptDir & "\测试\" & $shuzu1[$i])
For $j = 0 To UBound($shuzu2, 2) - 1
If $shuzu2[$i][$j] <> "" Then
FileMove(@ScriptDir & "\测试\" & $shuzu2[$i][$j], @ScriptDir & "\测试\" & $shuzu1[$i])
EndIf
Next
Next
|