StringSplit

  • Hey,

    kann mir jemand beim StringSplit helfen

    will eine datei bearbeiten

    \\server\share\order1\dummy.txt
    \\server\share\order2\test.log
    \\server\share\order3\lo.txt
    \\server\share\ordner\order4.txt

    Als ergebnis wollte ich:


    \\server\share\order1\
    \\server\share\order2\
    \\server\share\order3\
    \\server\share\ordner\


    Also vom ersten "\" von rechts alles abschneiden

    Vielen Dank
    SubZero

    lg SubZero ;)
    ==========================================================================

    "Der Computer ist die logische Weiterentwicklung des Menschen: Intelligenz ohne Moral."

    Einmal editiert, zuletzt von subzero007 (13. August 2009 um 17:06)

  • Und so "kööööönnnnnnte" man es auch machen: :rofl:

    Spoiler anzeigen
    [autoit]


    $fFile = "\\server\share\order1\dummy.txt"

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

    $array = StringSplit($fFile, '\', 1)
    MsgBox(0,"",$array[0])
    MsgBox(0,"",$array[1])
    MsgBox(0,"",$array[2])
    MsgBox(0,"",$array[3])
    MsgBox(0,"",$array[4])
    MsgBox(0,"",$array[5])
    MsgBox(0,"","Dieses String wird gleich nochmals geteilt : " & $array[6])

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

    $2_array = StringSplit($array[6], '.', 1)
    MsgBox(0,"",$2_array[0])
    MsgBox(0,"",$2_array[1])
    MsgBox(0,"",$2_array[2])
    ;MsgBox(0,"",$2_array[3])

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

    $3_array = StringSplit($array[3], '', 1)
    MsgBox(0,"",$3_array[0])
    MsgBox(0,"",$3_array[1]) ; = s
    MsgBox(0,"",$3_array[2]) ; = e
    MsgBox(0,"",$3_array[3]) ; = r
    MsgBox(0,"",$3_array[4]) ; = v
    MsgBox(0,"",$3_array[5]) ; = e
    MsgBox(0,"",$3_array[6]) ; = r

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

    $4_array = StringSplit($fFile, '', 1)
    MsgBox(0,"",$4_array[0])
    MsgBox(0,"",$4_array[1]) ; = \
    MsgBox(0,"",$4_array[2]) ; = \
    MsgBox(0,"",$4_array[3]) ; = s
    MsgBox(0,"",$4_array[4]) ; = e
    MsgBox(0,"",$4_array[5]) ; = r
    MsgBox(0,"",$4_array[6]) ; = v
    MsgBox(0,"",$4_array[7]) ; = e
    MsgBox(0,"",$4_array[8]) ; = r
    MsgBox(0,"",$4_array[9]) ; = \
    MsgBox(0,"",$4_array[10]) ; = s
    MsgBox(0,"",$4_array[11]) ; = h
    MsgBox(0,"",$4_array[12]) ; = a
    MsgBox(0,"",$4_array[13]) ; = r
    MsgBox(0,"",$4_array[14]) ; = e
    MsgBox(0,"",$4_array[15]) ; = \
    MsgBox(0,"",$4_array[16]) ; = o
    MsgBox(0,"",$4_array[17]) ; = r
    MsgBox(0,"",$4_array[18]) ; = d
    MsgBox(0,"",$4_array[19]) ; = n
    MsgBox(0,"",$4_array[20]) ; = e
    MsgBox(0,"",$4_array[21]) ; = r
    MsgBox(0,"",$4_array[22]) ; = 1
    MsgBox(0,"",$4_array[23]) ; = \
    MsgBox(0,"",$4_array[24]) ; = d
    MsgBox(0,"",$4_array[25]) ; = u
    MsgBox(0,"",$4_array[26]) ; = m
    MsgBox(0,"",$4_array[27]) ; = m
    MsgBox(0,"",$4_array[28]) ; = y
    MsgBox(0,"",$4_array[29]) ; = .
    MsgBox(0,"",$4_array[30]) ; = t
    MsgBox(0,"",$4_array[31]) ; = e

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

    ; Und was mag uns diese MsgBox wohl anzeigen ?????????
    MsgBox(0, "Test", MsgBox(0, "Test", $4_array[1]&$4_array[2]&$4_array[3]&$4_array[4]&$4_array[5]&$4_array[6]&$4_array[7]&$4_array[8]&$4_array[9]&$4_array[10]&$4_array[11]&$4_array[12]&$4_array[13]&$4_array[14]&$4_array[15]&$4_array[16]&$4_array[17]&$4_array[18]&$4_array[19]&$4_array[20]&$4_array[21]&$4_array[22])

    [/autoit]

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr