FrancoDM Posted October 1, 2020 Share Posted October 1, 2020 Func StringSplit2D($sMatches, $sDelim_Item = "-", $sDelim_Row = "|") Local $iValDim_1, $iValDim_2 = 0, $iColCount Local $aSplit_1 = StringSplit($sMatches, $sDelim_Row, $STR_NOCOUNT + $STR_ENTIRESPLIT) $iValDim_1 = UBound($aSplit_1, $UBOUND_ROWS) Local $aTmp[$iValDim_1][0], $aSplit_2 For $i = 0 To $iValDim_1 - 1 $aSplit_2 = StringSplit($aSplit_1[$i], $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT) $iColCount = UBound($aSplit_2) If $iColCount > $iValDim_2 Then $iValDim_2 = $iColCount ReDim $aTmp[$iValDim_1][$iValDim_2] EndIf For $j = 0 To $iColCount - 1 $aTmp[$i][$j] = $aSplit_2[$j] Next Next Return $aTmp EndFunc Link to comment Share on other sites More sharing options...
FrancoDM Posted October 1, 2020 Author Share Posted October 1, 2020 Just now, FrancoDM said: Func StringSplit2D($sMatches, $sDelim_Item = "-", $sDelim_Row = "|") Local $iValDim_1, $iValDim_2 = 0, $iColCount Local $aSplit_1 = StringSplit($sMatches, $sDelim_Row, $STR_NOCOUNT + $STR_ENTIRESPLIT) $iValDim_1 = UBound($aSplit_1, $UBOUND_ROWS) Local $aTmp[$iValDim_1][0], $aSplit_2 For $i = 0 To $iValDim_1 - 1 $aSplit_2 = StringSplit($aSplit_1[$i], $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT) $iColCount = UBound($aSplit_2) If $iColCount > $iValDim_2 Then $iValDim_2 = $iColCount ReDim $aTmp[$iValDim_1][$iValDim_2] EndIf For $j = 0 To $iColCount - 1 $aTmp[$i][$j] = $aSplit_2[$j] Next Next Return $aTmp EndFunc They are free to improve it, and add it to autoit, it is necessary. Link to comment Share on other sites More sharing options...
TheXman Posted October 1, 2020 Share Posted October 1, 2020 9 minutes ago, FrancoDM said: They are free to improve it, and add it to autoit, it is necessary. It already exists as _ArrayAdd CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
FrancoDM Posted October 1, 2020 Author Share Posted October 1, 2020 4 minutes ago, TheXman said: It already exists as _ArrayAdd Yes but not the same. Just the difficulties with stringslipt2d and wanted to share this code. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now