Array sortieren und doppelte Einträge finden

  • Hallo !

    Ich habe folgendes Szenario:

    * Festplatte nach bestimmten Dateien durchsuchen
    * Liste der Einträge nach Doppelten "FILENAMEN" durchsuchen
    * Diese dann in eine Datei schreiben

    Hab mir ein bisschen was zusammen gesucht und bin jetzt erstmal so weit :

    [autoit]

    dim $hFilesFolders[120]
    dim $path[100][3]
    dim $cab[100][3]
    dim $iCol, $DESCENDING ,$ext,$iROWstart, $iROWend, $iCOLstart, $iCOLend, $DELIM,$sValue
    $hFilesFolders = _FileListToArrayEx('h:', '*.zip')

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    For $i = 1 to $hFilesFolders[0]
    _PathSplit($hFilesFolders[$i], $path[$i][0],$path[$i][1], $path[$i][2],$ext)
    if $path[$i][2] = $path[$i-1][2] then
    _FileWriteLog(@tempdir & '\log.txt',$path[$i][0] & $path[$i][1] & $path[$i][2] & '.nvs' & @CRLF & $path[$i-1][0] & $path[$i-1][1] & $path[$i-1][2])
    EndIf
    Next

    [/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]

    Func _FileListToArrayEx($s_path, $s_mask, $i_flag = 0, $s_exclude = -1, $f_recurse = True, $f_full_path = True)

    [/autoit][autoit][/autoit][autoit]

    If FileExists($s_path) = 0 Then Return SetError(1, 1, 0)

    [/autoit][autoit][/autoit][autoit]

    ; Strip trailing backslash, and add one after to make sure there's only one
    $s_path = StringRegExpReplace($s_path, "[\\/]+\z", "") & "\"

    [/autoit][autoit][/autoit][autoit]

    ; Set all defaults
    If $s_mask = -1 Or $s_mask = Default Then $s_mask = "*.*"
    If $i_flag = -1 Or $i_flag = Default Then $i_flag = 0
    If $s_exclude = -1 Or $s_exclude = Default Then $s_exclude = ""

    [/autoit][autoit][/autoit][autoit]

    ; Look for bad chars
    If StringRegExp($s_mask, "[\\/:><\|]") Or StringRegExp($s_exclude, "[\\/:><\|]") Then
    Return SetError(2, 2, 0)
    EndIf

    [/autoit][autoit][/autoit][autoit]

    ; Strip leading spaces between semi colon delimiter
    $s_mask = StringRegExpReplace($s_mask, "\s*;\s*", ";")
    If $s_exclude Then $s_exclude = StringRegExpReplace($s_exclude, "\s*;\s*", ";")

    [/autoit][autoit][/autoit][autoit]

    ; Confirm mask has something in it
    If StringStripWS($s_mask, 8) = "" Then Return SetError(2, 2, 0)
    If $i_flag < 0 Or $i_flag > 2 Then Return SetError(3, 3, 0)

    [/autoit][autoit][/autoit][autoit]

    ; Validate and create path + mask params
    Local $a_split = StringSplit($s_mask, ";"), $s_hold_split = ""
    For $i = 1 To $a_split[0]
    If StringStripWS($a_split[$i], 8) = "" Then ContinueLoop
    If StringRegExp($a_split[$i], "^\..*?\..*?\z") Then
    $a_split[$i] &= "*" & $a_split[$i]
    EndIf
    $s_hold_split &= '"' & $s_path & $a_split[$i] & '" '
    Next
    $s_hold_split = StringTrimRight($s_hold_split, 1)
    If $s_hold_split = "" Then $s_hold_split = '"' & $s_path & '*.*"'

    [/autoit][autoit][/autoit][autoit]

    Local $i_pid, $s_stdout, $s_hold_out, $s_dir_file_only = "", $s_recurse = "/s "
    If $i_flag = 1 Then $s_dir_file_only = ":-d"
    If $i_flag = 2 Then $s_dir_file_only = ":d"
    If Not $f_recurse Then $s_recurse = ""

    [/autoit][autoit][/autoit][autoit]

    Local $i_buffer, $t_input, $t_output, $s_hold_binary

    [/autoit][autoit][/autoit][autoit]

    $i_pid = Run(@ComSpec & " /u /c dir /b " & _
    $s_recurse & "/a" & $s_dir_file_only & " " & _
    $s_hold_split, "", @SW_HIDE, 4 + 2)

    [/autoit][autoit][/autoit][autoit]

    ; Collect data from std i/o stream
    While 1
    $s_stdout = StdoutRead($i_pid, False, True)
    If @error Then ExitLoop
    $i_buffer = BinaryLen($s_stdout)
    $t_input = DllStructCreate("byte[" & $i_buffer & "]")
    $t_output = DllStructCreate("char[" & $i_buffer & "]")

    [/autoit][autoit][/autoit][autoit]

    DllStructSetData($t_input, 1, $s_stdout)
    DllCall("kernel32.dll", "int", "WideCharToMultiByte", _
    "int", 0, "int", 0, "ptr", DllStructGetPtr($t_input), _
    "int", $i_buffer / 2, "ptr", DllStructGetPtr($t_output), _
    "int", $i_buffer, "int", 0, "int", 0)

    [/autoit][autoit][/autoit][autoit]

    $s_hold_out &= StringRegExpReplace(DllStructGetData($t_output, 1), "(?i)(?:\A|\v)(?:(0+\v+)|(0+))|(\v*0+\z)", "")
    $t_input = 0
    $t_output = 0
    WEnd

    [/autoit][autoit][/autoit][autoit]

    ; Replace any extending verticle spaces from the end of the string
    $s_hold_out = StringRegExpReplace($s_hold_out, "\v+\z", "")
    If Not $s_hold_out Then Return SetError(5, 5, 0)

    [/autoit][autoit][/autoit][autoit]

    ; Parse data and find matches based on flags
    Local $a_fsplit = StringSplit(StringStripCR($s_hold_out), @LF), $s_hold_ret
    $s_hold_out = ""

    [/autoit][autoit][/autoit][autoit]

    If $s_exclude Then $s_exclude = StringReplace(StringReplace($s_exclude, "*", ".*?"), ";", "|")
    Local $i_path_len = BinaryLen($s_path)

    [/autoit][autoit][/autoit][autoit]

    For $i = 1 To $a_fsplit[0]
    If $s_exclude And StringRegExp(StringRegExpReplace( _
    $a_fsplit[$i], "(.*?[\\/]+)*(.*?\z)", "\2"), "(?i)" & $s_exclude) Then ContinueLoop
    If StringRegExp($a_fsplit[$i], "^\w:[\\/]+") = 0 Then $a_fsplit[$i] = $s_path & $a_fsplit[$i]
    If $f_full_path Then
    $s_hold_ret &= $a_fsplit[$i] & Chr(1)
    Else
    $s_hold_ret &= StringTrimLeft($a_fsplit[$i], $i_path_len) & Chr(1)
    EndIf
    Next

    [/autoit][autoit][/autoit][autoit]

    $s_hold_ret = StringTrimRight($s_hold_ret, 1)
    If $s_hold_ret = "" Then Return SetError(6, 6, 0)

    [/autoit][autoit][/autoit][autoit]

    Return StringSplit($s_hold_ret, Chr(1))
    EndFunc

    [/autoit]

    Vielleicht würde das sogar so in der Art funktionieren, wenn ich es vorher schaffen würde $path nach der Spalte $path[$i][2] von A-Z zu formatieren.

    Würde mich über eine paar Kommentare freuen

    so far baar

    Einmal editiert, zuletzt von baar (10. August 2009 um 16:10)

  • hab jetz nich alles gelesen aber ich würde einfach ma sagen schau dir ma array.au3 an

    [autoit]


    #include <array.au3>
    _arrayunique($array)
    ; unter umständen _arraydelete($array,0), weil in $array[0] die anzahl der doppelten einträge steht
    _ArraySort($array)

    [/autoit]
  • hm,

    ich will ja nicht doppelte einträge löschen!
    Sondern doppelte finden und mit ihnen weiterarbeiten

    bin jetzt nochmal weiter gekommen (denke ich :rofl: )

    [autoit]

    for $i = 1 to $hFilesFolders[0]
    _PathSplit($hFilesFolders[$i], $path[$i][0],$path[$i][1], $path[$i][2],$ext)
    _ArraySort($path, 0, 0, 0, 2)
    if $path[$i][2] = $path[$i+1][2] and not '' Then
    _FileWriteLog(@tempdir & '\log.txt',$path[$i][0] & $path[$i][1] & $path[$i][2] & @CRLF & $path[$i+1][0] & $path[$i+1][1] & $path[$i+1][2])
    EndIf

    [/autoit][autoit][/autoit][autoit]

    Next
    _ArrayDisplay($path)

    [/autoit]

    jedoch stimmt hier die das log.txt nicht wirklich :D

    dafür aber die Ausgabe von $path

    Wie ist es denn möglich von $path[0-100][2] die Werte miteinander zu vergleichen ?
    Es würde ja schon genügen wenn man checkt ob $path[1][2] = $path[2][2] ist
    und dann eben zusammen mit den anderen dimensionen die doppelten werte ausgibt.

  • So vllt?

    Spoiler anzeigen
    [autoit]

    #include<Array.au3>
    Opt("MustDeclareVars", 1)
    Local $test

    [/autoit] [autoit][/autoit] [autoit]

    Dim $array[6] = [1, 2, 2, 3, 4, 2]
    Dim $array2[3] = [1, 2, 3]
    _ArrayDisplay($array)

    [/autoit] [autoit][/autoit] [autoit]

    $test = _ArrayDoubles($array, 1)
    _ArrayDisplay($test)
    MsgBox(0, "", $test)

    [/autoit] [autoit][/autoit] [autoit]

    Func _ArrayDoubles(ByRef $array, $uniqueres = 0, $icase = 0, $start = 0, $end = 0)
    Local $out = 0, $end2
    If Not IsArray($array) Then Return SetError(1)
    If UBound($array, 0) > 1 Then Return SetError(2)
    If $start < 0 Or $start > UBound($array)-1 Then Return SetError(3)
    If $end < 0 Or $end > UBound($array)-1 Then Return SetError(4)
    If $end = 0 Then
    $end2 = UBound($array) - 1
    Else
    $end2 = $end
    EndIf

    For $i = $start To $end2
    If _ArraySearch($array, $array[$i], $i+1, 0, $icase) <> -1 Then
    If $uniqueres = 0 Or ($uniqueres = 1 And _ArraySearch($out, $array[$i], 0, 0, $icase) = -1) Then
    If Not IsArray($out) Then
    Dim $out[1] = [ $array[$i] ]
    Else
    _ArrayAdd($out, $array[$i])
    EndIf
    EndIf
    EndIf
    Next
    Return $out
    EndFunc

    [/autoit]

    MFG FireFlyer

    *Paradox ist, wenn man sich im Handumdrehen den Fuss bricht* :D

    Einmal editiert, zuletzt von FireFlyer (9. August 2009 um 23:50)

  • mit der methode von fireflyer hab ichs leider nicht hinbekommen

    jedoch bin ich jetzt wieder einen schritt weiter.
    Mein jetziges Problem ist nur noch das am ende der auswertung

    Zitat

    (60) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

    kommt. Zeile 60 entspricht hier Zeile 22
    nachdem ich alle msgboxen durchgeklickt habe kommt der oben erwähnte fehler


    [autoit]

    dim $hFilesFolders[120]
    dim $cab[100][3]
    dim $iCol, $ext
    Dim $path[200][3] ;element 0,0 to 9,19
    dim $out[200]
    dim $col
    ; file mask to search for
    $hFilesFolders = _FileListToArrayEx('h:', '*.nvs')

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    for $i = 1 to $hFilesFolders[0]
    _PathSplit($hFilesFolders[$i], $path[$i][0],$path[$i][1], $path[$i][2],$ext)
    _ArrayInsert($out, $i,$path[$i][2])
    Next
    _ArraySort($path,0,0,0,2)
    _arraysort($out,0,0,0,0)
    _Array2DEmptyDel($path, $Col=1)
    _Array2DEmptyDel($out, $Col=0)
    _ArrayDisplay($out)
    _ArrayDisplay($path)
    for $i = 1 to $out[0]
    if $out[$i] = $path[$i+1][2] Then
    MsgBox(0,"title",$out[$i] & @CRLF & $path[$i+1][2])
    EndIf
    Next

    [/autoit]

    ich weiß einfach nicht mehr weiter ;(

    Hat jemand eine Idee warum der Fehler kommt ?

    • Offizieller Beitrag

    Ich konnte auch gerade so ein Tool gebrauchen, deshalb habe ich mal eins geschrieben:

    Spoiler anzeigen
    [autoit]


    $sSearchPath = 'h:\' ; Pfad der durchsucht werden soll (rekursiv)
    $sSearchPattern = '.+\.zip' ; RegExp-Pattern
    $sSavePath = @ScriptDir & '\Doppelte.txt' ; Datei (inkl. Pfad), in der die doppelten gespeichert werden

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ToolTip('Bitte warten! Verzeichnis wird eingelesen!', @DesktopWidth/2-100, 80, 'Double-Finder', 1, 7)
    Global $aFiles = _RecursiveFileListToArray($sSearchPath, $sSearchPattern, 1)
    Global $sExists = '|', $sFilename = '', $sDouble = '', $iPos = 0
    ToolTip($aFiles[0] & ' Dateien gefunden' & @CRLF & 'Bitte warten! Doppelte werden gesucht!', @DesktopWidth/2-100, 100, 'Double-Finder', 1, 7)
    For $i = 1 To $aFiles[0]
    $sFilename = StringRegExpReplace($aFiles[$i], '.+\\(.+)', '$1')
    $iPos = StringInStr($sExists, '\' & $sFilename)
    If $iPos Then
    $iStart = StringInStr($sExists, '|', 0, -1, $iPos)
    $iEnd = StringInStr($sExists, '|', 0, 1, $iPos)
    $sDouble &= StringMid($sExists, $iStart, $iEnd - $iStart) & '|'
    $sDouble &= $aFiles[$i] & '|'
    EndIf
    $sExists &= $aFiles[$i] & '|'
    Next
    $hFile = FileOpen($sSavePath, 2)
    FileWrite($hFile, StringReplace($sDouble, '|', @CRLF))
    FileClose($hFile)
    ShellExecute('notepad.exe', $sSavePath)
    ToolTip('Fertig! Datei erstellt!', @DesktopWidth/2-100, 120, 'Double-Finder', 1, 7)
    Sleep(3000)
    Exit

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;===============================================================================
    ; Function Name: _RecursiveFileListToArray($sPath, $sPattern, $iFlag = 0, $iFormat = 1, $sDelim = @CRLF)
    ; Description:: gibt Verzeichnisse und/oder Dateien (rekursiv) zurück, die
    ; einem RegExp-Pattern entsprechen
    ; Parameter(s): $sPath = Startverzeichnis
    ; $sPattern = ein beliebiges RexExp-Pattern für die Auswahl
    ; $iFlag = Auswahl
    ; 0 = Dateien & Verzeichnisse
    ; 1 = nur Dateien
    ; 2 = nur Verzeichnisse
    ; $iFormat = Rückgabeformat
    ; 0 = String
    ; 1 = Array mit [0] = Anzahl
    ; 2 = Nullbasiertes Array
    ; $sDelim = Trennzeichen für die String-Rückgabe
    ; Requirement(s): AutoIt 3.3.0.0
    ; Return Value(s): Array/String mit den gefundenen Dateien/Verzeichnissen
    ; Author(s): Oscar (http://www.autoit.de)
    ; Anregungen von: bernd670 (http://www.autoit.de)
    ;===============================================================================
    Func _RecursiveFileListToArray($sPath, $sPattern, $iFlag = 0, $iFormat = 1, $sDelim = @CRLF)
    Local $hSearch, $sFile, $sReturn = ''
    If StringRight($sPath, 1) <> '\' Then $sPath &= '\'
    $hSearch = FileFindFirstFile($sPath & '*.*')
    If @error Or $hSearch = -1 Then Return SetError(0, 0, $sReturn)
    While True
    $sFile = FileFindNextFile($hSearch)
    If @error Then ExitLoop
    If StringInStr(FileGetAttrib($sPath & $sFile), 'D') Then
    If StringRegExp($sPath & $sFile, $sPattern) And ($iFlag = 0 Or $iFlag = 2) Then $sReturn &= $sPath & $sFile & '\' & $sDelim
    $sReturn &= _RecursiveFileListToArray($sPath & $sFile & '\', $sPattern, $iFlag, 0)
    ContinueLoop
    EndIf
    If StringRegExp($sFile, $sPattern) And ($iFlag = 0 Or $iFlag = 1) Then $sReturn &= $sPath & $sFile & $sDelim
    WEnd
    FileClose($hSearch)
    If $iFormat Then Return StringSplit(StringTrimRight($sReturn, StringLen($sDelim)), $sDelim, $iFormat)
    Return $sReturn
    EndFunc

    [/autoit]

    Das Script findet alle doppelten Dateien im Suchpfad und listet diese auf. Die drei Variablen ganz oben müssen entsprechend angepasst werden.
    Ist auch ganz gut geeignet zum finden von doppelten MP3s. :)
    Mit der Anzahl der gefundenen Dateien steigt allerdings auch die Rechenzeit an. Bei vielen Dateien (und/oder langsamen Rechner) nur Geduld, das Script läuft noch. ;)

  • Vielen Danke Oscar !!!

    hab mir mal erlaubt die such funktion auszutauschen !

    diese geht um einiges schneller !

    rest funktioniert perfekt

    Spoiler anzeigen
    [autoit]

    $sSearchPath = 'h:' ; Pfad der durchsucht werden soll (rekursiv)
    $sSearchPattern = '*.zip' ; RegExp-Pattern
    $sSavePath = @ScriptDir & '\Doppelte.txt' ; Datei (inkl. Pfad), in der die doppelten gespeichert werden

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ToolTip('Bitte warten! Verzeichnis wird eingelesen!', @DesktopWidth/2-100, 80, 'Double-Finder', 1, 7)
    Global $aFiles = _FileListToArrayEx($sSearchPath, $sSearchPattern)
    Global $sExists = '|', $sFilename = '', $sDouble = '', $iPos = 0
    ToolTip($aFiles[0] & ' Dateien gefunden' & @CRLF & 'Bitte warten! Doppelte werden gesucht!', @DesktopWidth/2-100, 100, 'Double-Finder', 1, 7)
    For $i = 1 To $aFiles[0]
    $sFilename = StringRegExpReplace($aFiles[$i], '.+\\(.+)', '$1')
    $iPos = StringInStr($sExists, '\' & $sFilename)
    If $iPos Then
    $iStart = StringInStr($sExists, '|', 0, -1, $iPos)
    $iEnd = StringInStr($sExists, '|', 0, 1, $iPos)
    $sDouble &= StringMid($sExists, $iStart, $iEnd - $iStart) & '|'
    $sDouble &= $aFiles[$i] & '|'
    EndIf
    $sExists &= $aFiles[$i] & '|'
    Next
    $hFile = FileOpen($sSavePath, 2)
    FileWrite($hFile, StringReplace($sDouble, '|', @CRLF))
    FileClose($hFile)
    ShellExecute('notepad.exe', $sSavePath)
    ToolTip('Fertig! Datei erstellt!', @DesktopWidth/2-100, 120, 'Double-Finder', 1, 7)
    Sleep(3000)
    Exit

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _FileListToArrayEx($s_path, $s_mask, $i_flag = 0, $s_exclude = -1, $f_recurse = True, $f_full_path = True)

    [/autoit] [autoit][/autoit] [autoit]

    If FileExists($s_path) = 0 Then Return SetError(1, 1, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; Strip trailing backslash, and add one after to make sure there's only one
    $s_path = StringRegExpReplace($s_path, "[\\/]+\z", "") & "\"

    [/autoit] [autoit][/autoit] [autoit]

    ; Set all defaults
    If $s_mask = -1 Or $s_mask = Default Then $s_mask = "*.*"
    If $i_flag = -1 Or $i_flag = Default Then $i_flag = 0
    If $s_exclude = -1 Or $s_exclude = Default Then $s_exclude = ""

    [/autoit] [autoit][/autoit] [autoit]

    ; Look for bad chars
    If StringRegExp($s_mask, "[\\/:><\|]") Or StringRegExp($s_exclude, "[\\/:><\|]") Then
    Return SetError(2, 2, 0)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Strip leading spaces between semi colon delimiter
    $s_mask = StringRegExpReplace($s_mask, "\s*;\s*", ";")
    If $s_exclude Then $s_exclude = StringRegExpReplace($s_exclude, "\s*;\s*", ";")

    [/autoit] [autoit][/autoit] [autoit]

    ; Confirm mask has something in it
    If StringStripWS($s_mask, 8) = "" Then Return SetError(2, 2, 0)
    If $i_flag < 0 Or $i_flag > 2 Then Return SetError(3, 3, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; Validate and create path + mask params
    Local $a_split = StringSplit($s_mask, ";"), $s_hold_split = ""
    For $i = 1 To $a_split[0]
    If StringStripWS($a_split[$i], 8) = "" Then ContinueLoop
    If StringRegExp($a_split[$i], "^\..*?\..*?\z") Then
    $a_split[$i] &= "*" & $a_split[$i]
    EndIf
    $s_hold_split &= '"' & $s_path & $a_split[$i] & '" '
    Next
    $s_hold_split = StringTrimRight($s_hold_split, 1)
    If $s_hold_split = "" Then $s_hold_split = '"' & $s_path & '*.*"'

    [/autoit] [autoit][/autoit] [autoit]

    Local $i_pid, $s_stdout, $s_hold_out, $s_dir_file_only = "", $s_recurse = "/s "
    If $i_flag = 1 Then $s_dir_file_only = ":-d"
    If $i_flag = 2 Then $s_dir_file_only = ":d"
    If Not $f_recurse Then $s_recurse = ""

    [/autoit] [autoit][/autoit] [autoit]

    Local $i_buffer, $t_input, $t_output, $s_hold_binary

    [/autoit] [autoit][/autoit] [autoit]

    $i_pid = Run(@ComSpec & " /u /c dir /b " & _
    $s_recurse & "/a" & $s_dir_file_only & " " & _
    $s_hold_split, "", @SW_HIDE, 4 + 2)

    [/autoit] [autoit][/autoit] [autoit]

    ; Collect data from std i/o stream
    While 1
    $s_stdout = StdoutRead($i_pid, False, True)
    If @error Then ExitLoop
    $i_buffer = BinaryLen($s_stdout)
    $t_input = DllStructCreate("byte[" & $i_buffer & "]")
    $t_output = DllStructCreate("char[" & $i_buffer & "]")

    [/autoit] [autoit][/autoit] [autoit]

    DllStructSetData($t_input, 1, $s_stdout)
    DllCall("kernel32.dll", "int", "WideCharToMultiByte", _
    "int", 0, "int", 0, "ptr", DllStructGetPtr($t_input), _
    "int", $i_buffer / 2, "ptr", DllStructGetPtr($t_output), _
    "int", $i_buffer, "int", 0, "int", 0)

    [/autoit] [autoit][/autoit] [autoit]

    $s_hold_out &= StringRegExpReplace(DllStructGetData($t_output, 1), "(?i)(?:\A|\v)(?:(0+\v+)|(0+))|(\v*0+\z)", "")
    $t_input = 0
    $t_output = 0
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ; Replace any extending verticle spaces from the end of the string
    $s_hold_out = StringRegExpReplace($s_hold_out, "\v+\z", "")
    If Not $s_hold_out Then Return SetError(5, 5, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; Parse data and find matches based on flags
    Local $a_fsplit = StringSplit(StringStripCR($s_hold_out), @LF), $s_hold_ret
    $s_hold_out = ""

    [/autoit] [autoit][/autoit] [autoit]

    If $s_exclude Then $s_exclude = StringReplace(StringReplace($s_exclude, "*", ".*?"), ";", "|")
    Local $i_path_len = BinaryLen($s_path)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $a_fsplit[0]
    If $s_exclude And StringRegExp(StringRegExpReplace( _
    $a_fsplit[$i], "(.*?[\\/]+)*(.*?\z)", "\2"), "(?i)" & $s_exclude) Then ContinueLoop
    If StringRegExp($a_fsplit[$i], "^\w:[\\/]+") = 0 Then $a_fsplit[$i] = $s_path & $a_fsplit[$i]
    If $f_full_path Then
    $s_hold_ret &= $a_fsplit[$i] & Chr(1)
    Else
    $s_hold_ret &= StringTrimLeft($a_fsplit[$i], $i_path_len) & Chr(1)
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $s_hold_ret = StringTrimRight($s_hold_ret, 1)
    If $s_hold_ret = "" Then Return SetError(6, 6, 0)

    [/autoit] [autoit][/autoit] [autoit]

    Return StringSplit($s_hold_ret, Chr(1))
    EndFunc

    [/autoit]

    2 Mal editiert, zuletzt von baar (10. August 2009 um 16:10)