本帖最后由 zghwelcome 于 2019-5-5 09:15 编辑
#include <array.au3>
Local $sClipData = ClipGet()
Local $aAry = _ClipData_ToArray($sClipData)
If Not @error Then _ArrayDisplay($aAry)
Func _ClipData_ToArray($sClipData)
Local $aReg, $sEveryLine, $aSplit
If $sClipData = '' Then Return SetError(1)
$aReg = StringRegExp($sClipData, '\V+', 3)
If @error Then Return SetError(2)
Local $aAry_Ret[UBound($aReg)][1]
For $i = 0 To UBound($aReg) - 1
$sEveryLine = $aReg[$i]
$aSplit = StringSplit($sEveryLine, BinaryToString('0x09',4), 1) ;//里面的tab符发论坛变多个空格了
If Not @error Then
If $aSplit[0] > UBound($aAry_Ret, 2) Then ReDim $aAry_Ret[UBound($aReg)][$aSplit[0]]
For $j = 0 To $aSplit[0] - 1
$aAry_Ret[$i][$j] = $aSplit[$j + 1]
Next
Else
$aAry_Ret[$i][0] = $sEveryLine
EndIf
Next
Return $aAry_Ret
EndFunc ;==>_ClipData_ToArray
|