Sign in to follow this  
Followers 0
nnxxgkf

Can you do me a favor, ArrayDisplay ,ArrayDisplay ,Display

3 posts in this topic

#1 ·  Posted (edited)

 

#include <Array.au3>

Local $sData = _
                '1|ccc.txt|werrt' & @CRLF & _
                '2|abb.exe|12234' & @CRLF & _
                '3|wer/ad.cmd|1sdf' & @CRLF & _
                '4|0er/ads.bat|1234'
Local $sData1 = _
                '1|abc.txt|werrt' & @CRLF & _
                '2|bbb.exe|12234' & @CRLF & _
                '3|wer/ad.cmd|1sdf' & @CRLF & _
                '4|1er/ads.bat|1234'
Local $sData2 = _
                '1|efg.txt|werrt' & @CRLF & _
                '2|cbb.exe|12234' & @CRLF & _
                '3|wer/ad.cmd|1sdf' & @CRLF & _
                '4|2er/ads.bat|1234'
Local $sData3 = _
                '1|qqwe.txt|werrt' & @CRLF & _
                '2|dbb.exe|12234' & @CRLF & _
                '3|wer/ad.cmd|1sdf' & @CRLF & _
                '4|3er/ads.bat|1234'
Local $atmp = StringRegExp($sData, '(?m)^(d+).([^|]+).([^|]+)s*$', 3)
Local $atmp1 = StringRegExp($sData1, '(?m)^(d+).([^|]+).([^|]+)s*$', 3)
Local $atmp2 = StringRegExp($sData2, '(?m)^(d+).([^|]+).([^|]+)s*$', 3)
Local $atmp3 = StringRegExp($sData3, '(?m)^(d+).([^|]+).([^|]+)s*$', 3)
If @Error Then Exit
Local $aData[uBound($atmp) / 3][3], $x
For $i = 0 To UBound($atmp) - 1 Step 3
        $aData[$x][0] = $atmp[$i]
        $aData[$x][1] = $atmp[$i + 1]
        $aData[$x][2] = $atmp[$i + 2]
        $x += 1
Next
_ArrayDisplay($aData, UBound($aData))

20140427094413.jpg

Edited by nnxxgkf

Share this post


Link to post
Share on other sites



Maybe something like this.

#include <Array.au3>
Local $sData = _
        '1|ccc.txt|werrt' & @CRLF & _
        '2|abb.exe|12234' & @CRLF & _
        '3|wer/ad.cmd|1sdf' & @CRLF & _
        '4|0er/ads.bat|1234'
Local $sData1 = _
        '1|abc.txt|werrt' & @CRLF & _
        '2|bbb.exe|12234' & @CRLF & _
        '3|wer/ad.cmd|1sdf' & @CRLF & _
        '4|1er/ads.bat|1234'
Local $sData2 = _
        '1|efg.txt|werrt' & @CRLF & _
        '2|cbb.exe|12234' & @CRLF & _
        '3|wer/ad.cmd|1sdf' & @CRLF & _
        '4|2er/ads.bat|1234'
Local $sData3 = _
        '1|qqwe.txt|werrt' & @CRLF & _
        '2|dbb.exe|12234' & @CRLF & _
        '3|wer/ad.cmd|1sdf' & @CRLF & _
        '4|3er/ads.bat|1234'
Local $atmp = StringRegExp($sData, '[^|\r\n]+', 3)
Local $atmp1 = StringRegExp($sData1, '[^|\r\n]+', 3)
Local $atmp2 = StringRegExp($sData2, '(?m)^(\d+).([^|]+).([^|]+)\s*$', 3)
Local $atmp3 = StringRegExp($sData3, '(?m)^(\d+).([^|]+).([^|]+)\s*$', 3)

If @error Then Exit
Local $aData4[4][9]
For $i = 0 To 3
    $aData4[$i][0] = $atmp[$i * 3]
    $aData4[$i][1] = $atmp[$i * 3 + 1]
    $aData4[$i][2] = $atmp[$i * 3 + 2]
    $aData4[$i][3] = $atmp1[$i * 3 + 1]
    $aData4[$i][4] = $atmp1[$i * 3 + 2]
    $aData4[$i][5] = $atmp2[$i * 3 + 1]
    $aData4[$i][6] = $atmp2[$i * 3 + 2]
    $aData4[$i][7] = $atmp3[$i * 3 + 1]
    $aData4[$i][8] = $atmp3[$i * 3 + 2]
Next
_ArrayDisplay($aData4)

Share this post


Link to post
Share on other sites

ok,This is what I need, thank you

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0