Versuch doch mal
Case $Button1
MouseMove()
MouseClick()
hinzuzufügen
Versuch doch mal
Case $Button1
MouseMove()
MouseClick()
hinzuzufügen
hab ich anfangs auch geglaubt das es einfacher geht aber nach langem hin und her war das der einzige weg um die Daten korrekt auszulesen
Deswegen auch am Anfang der Versuch das Problem theoretisch zu lösen ohne Script. Hab mir schon gedacht das da bei der Ordnung ohne Kommis keiner so schnell hintersteigt.
Bei mir ist das alles auch schön geschachtelt aber hab da noch so meine Probleme beim anständigen posten
Hat den Jemand eine theoretische Lösung Betreff der Fehlermeldung bezogen auf das Wend?
keiner eine Idee ?
Dass ich ein Array aufrufe dessen Größe ich anscheinend überschreite ist mir klar jedoch gibt die Fehlermeldung sonst dass überschrittene Array an und nicht Wend ich weiß halt dadurch nicht genau welches Array und wo es bugt. Dachte das Problem könnte sich theoretisch lösen ohne Script aber kein Problem hier ist es
Danke schon einmal im voraus.
#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.4.0
Author: ScarfacePH
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]#include <file.au3>
#Include <String.au3>
Dim $aRecords
$file = FileOpen("test2.txt", 1)
$file2 = FileOpen("test.txt", 0)
$Lese = _FileReadToArray("test.txt",$aRecords)
$pl0 = "Text 1"
$pl1 = "Text 2"
$pl2 = "Text 3"
$pl3 = "Text 4"
$pl4 = "Text 5"
$pl5 = "Text 6"
$pl6 = "Text 7"
$pl7 = "Text 8"
$pl8 = "Text 9"
; Prüfen, ob Datei im Schreibmodus geöffnet ist
If $file = -1 Then
MsgBox(0, "Fehler", "Die Datei konnte nicht geöffnet werden.")
Exit
EndIf
If Not $Lese Then
MsgBox(4096,"Error", " Fehler beim Einlesen der Datei Fehler:" & @error)
Exit
EndIf
If $Lese Then
MsgBox(4096,"ok", "kein Fehler beim Einlesen der Datei Fehler:" & @error)
EndIf
For $x = 1 to $aRecords[0]
While StringInStr($aRecords[$x], "Herr") ; Eintrag ist vorhanden
FileWriteLine($file, "1 |" & $aRecords[$x]) ; was immer du dann machen willst
$i = 1
While $x < $aRecords[0]
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x], $pl0) Then
$pos0 = StringSplit($aRecords[$x], " ")
$x = $x - $i + 1
ExitLoop
EndIf
If $i = 40 Then
$x = $x - $i + 1
$pos0 = StringSplit("bestellt ein", " ")
ExitLoop
EndIf
If Not StringInStr($aRecords[$x], $pl0) Then
$x = $x + 1
$i = $i + 1
EndIf
WEnd
$i = 1
While $x < $aRecords[0]
If StringInStr($aRecords[$x], $pl1) Then
$pos1 = StringSplit($aRecords[$x], " ")
$x = $x - $i + 1
ExitLoop
EndIf
If Not StringInStr($aRecords[$x], $pl1) Then
$x = $x + 1
$i = $i + 1
EndIf
If $i = 40 Then
$x = $x - $i + 1
$pos1 = StringSplit("bestellt ein", " ")
ExitLoop
EndIf
WEnd
$i = 1
While $x < $aRecords[0]
If StringInStr($aRecords[$x], $pl2) Then
$pos2 = StringSplit($aRecords[$x], " ")
$x = $x - $i + 1
ExitLoop
EndIf
If Not StringInStr($aRecords[$x], $pl2) Then
$x = $x + 1
$i = $i + 1
EndIf
If $i = 40 Then
$x = $x - $i + 1
$pos2 = StringSplit("bestellt ein", " ")
ExitLoop
EndIf
WEnd
$i = 1
While $x < $aRecords[0]
If StringInStr($aRecords[$x], $pl3) Then
$pos3 = StringSplit($aRecords[$x], " ")
$x = $x - $i + 1
ExitLoop
EndIf
If Not StringInStr($aRecords[$x], $pl3) Then
$x = $x + 1
$i = $i + 1
EndIf
If $i = 40 Then
$x = $x - $i + 1
$pos3 = StringSplit("bestellt ein", " ")
ExitLoop
EndIf
WEnd
$i = 1
While $x < $aRecords[0]
If StringInStr($aRecords[$x], $pl4) Then
$pos4 = StringSplit($aRecords[$x], " ")
$x = $x - $i + 1
ExitLoop
EndIf
If Not StringInStr($aRecords[$x], $pl4) Then
$x = $x + 1
$i = $i + 1
EndIf
If $i = 40 Then
$x = $x - $i + 1
$pos4 = StringSplit("bestellt ein", " ")
ExitLoop
EndIf
WEnd
$i = 1
While $x < $aRecords[0]
If StringInStr($aRecords[$x], $pl5) Then
$pos5 = StringSplit($aRecords[$x], " ")
$x = $x - $i + 1
ExitLoop
EndIf
If Not StringInStr($aRecords[$x], $pl5) Then
$x = $x + 1
$i = $i + 1
EndIf
If $i = 40 Then
$x = $x - $i + 1
$pos5 = StringSplit("bestellt ein", " ")
ExitLoop
EndIf
WEnd
$i = 1
While $x < $aRecords[0]
If StringInStr($aRecords[$x], $pl6) Then
$pos6 = StringSplit($aRecords[$x], " ")
$x = $x - $i + 1
ExitLoop
EndIf
If Not StringInStr($aRecords[$x], $pl6) Then
$x = $x + 1
$i = $i + 1
EndIf
If $i = 40 Then
$x = $x - $i + 1
$pos6 = StringSplit("bestellt ein", " ")
ExitLoop
EndIf
WEnd
$i = 1
While $x < $aRecords[0]
If StringInStr($aRecords[$x], $pl7) Then
$pos7 = StringSplit($aRecords[$x], " ")
$x = $x - $i + 1
ExitLoop
EndIf
If Not StringInStr($aRecords[$x], $pl7) Then
$x = $x + 1
$i = $i + 1
EndIf
If $i = 40 Then
$x = $x - $i + 1
$pos7 = StringSplit("bestellt ein", " ")
ExitLoop
EndIf
WEnd
$i = 1
While $x < $aRecords[0]
If StringInStr($aRecords[$x], $pl8) Then
$pos8 = StringSplit($aRecords[$x], " ")
$x = $x - $i + 1
ExitLoop
EndIf
If Not StringInStr($aRecords[$x], $pl8) Then
$x = $x + 1
$i = $i + 1
EndIf
If $i = 40 Then
$x = $x - $i + 1
$pos8 = StringSplit("bestellt ein", " ")
ExitLoop
EndIf
WEnd
$erg1 = StringSplit($aRecords[$x], ":")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x], $erg1[1]) Then
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]If $erg1[1] = $pos0[3] Then
$z = 1
While 1
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x],$pl0) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
$RegEx = StringRegExp($aRecords[$x],".+\[(.+)\].+",3)
If isArray($RegEx) = True Then FileWriteLine($file, "4 |"& $RegEx[0])
$x = $x - $z + 1
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl0) Then
$x = $x + 1
$z = $z + 1
EndIf
WEnd
EndIf
If $erg1[1] = $pos1[3] Then
$z = 1
While 1
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x],$pl1) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
$RegEx = StringRegExp($aRecords[$x],".+\[(.+)\].+",3)
If isArray($RegEx) = True Then FileWriteLine($file, "4 |"& $RegEx[0])
$x = $x - $z + 1
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl1) Then
$x = $x + 1
$z = $z + 1
EndIf
WEnd
EndIf
If $erg1[1] = $pos2[3] Then
$z = 1
While 1
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x],$pl2) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
$RegEx = StringRegExp($aRecords[$x],".+\[(.+)\].+",3)
If isArray($RegEx) = True Then FileWriteLine($file, "4 |"& $RegEx[0])
$x = $x - $z + 1
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl2) Then
$x = $x + 1
$z = $z + 1
EndIf
WEnd
EndIf
If $erg1[1] = $pos3[3] Then
$z = 1
While 1
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x],$pl3) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
$RegEx = StringRegExp($aRecords[$x],".+\[(.+)\].+",3)
If isArray($RegEx) = True Then FileWriteLine($file, "4 |"& $RegEx[0])
$x = $x - $z + 1
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl3) Then
$x = $x + 1
$z = $z + 1
EndIf
WEnd
EndIf
If $erg1[1] = $pos4[3] Then
$z = 1
While 1
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x],$pl4) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
$RegEx = StringRegExp($aRecords[$x],".+\[(.+)\].+",3)
If isArray($RegEx) = True Then FileWriteLine($file, "4 |"& $RegEx[0])
$x = $x - $z + 1
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl4) Then
$x = $x + 1
$z = $z + 1
EndIf
WEnd
EndIf
If $erg1[1] = $pos5[3] Then
$z = 1
While 1
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x],$pl5) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
$RegEx = StringRegExp($aRecords[$x],".+\[(.+)\].+",3)
If isArray($RegEx) = True Then FileWriteLine($file, "4 |"& $RegEx[0])
$x = $x - $z + 1
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl5) Then
$x = $x + 1
$z = $z + 1
EndIf
WEnd
EndIf
If $erg1[1] = $pos6[3] Then
$z = 1
While 1
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x],$pl6) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
$RegEx = StringRegExp($aRecords[$x],".+\[(.+)\].+",3)
If isArray($RegEx) = True Then FileWriteLine($file, "4 |"& $RegEx[0])
$x = $x - $z + 1
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl6) Then
$x = $x + 1
$z = $z + 1
EndIf
WEnd
EndIf
If $erg1[1] = $pos7[3] Then
$z = 1
While 1
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x],$pl7) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
$RegEx = StringRegExp($aRecords[$x],".+\[(.+)\].+",3)
If isArray($RegEx) = True Then FileWriteLine($file, "4 |"& $RegEx[0])
$x = $x - $z + 1
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl7) Then
$x = $x + 1
$z = $z + 1
EndIf
WEnd
EndIf
If $erg1[1] = $pos8[3] Then
$z = 1
While 1
[/autoit] [autoit][/autoit] [autoit]If StringInStr($aRecords[$x],$pl8) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
$RegEx = StringRegExp($aRecords[$x],".+\[(.+)\].+",3)
If isArray($RegEx) = True Then FileWriteLine($file, "4 |"& $RegEx[0])
$x = $x - $z + 1
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl8) Then
$x = $x + 1
$z = $z + 1
EndIf
WEnd
EndIf
EndIf
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]If Not StringInStr($aRecords[$x], $erg1) Then
$x = $x + 1
EndIf
WEnd
[/autoit] [autoit][/autoit] [autoit]Next
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]FileClose($file)
MsgBox(4096,"Fertig", "Datei fertig ausgelesen")
Exit
Hallo zusammen
Und zwar habe ich ein Script geschrieben welches einen Text ausliest und in einen neuen hinein schreibt.
Es funktioniert auch soweit ganz gut, in der neuen .txt Datei fehlt lediglich die letzte Zeile und dann bricht das Script ab und gibt mir diese Fehlermeldung
C:\Users\ScarfacePH\Desktop\neu.au3 (434) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
WEnd
WEnd^ ERROR
Kann mir da bitte einer weiterhelfen
MfG
ScarfacePH
Dank all eurer Hilfe bin nun endlich fast an meinem Ziel danke sehr.
Funktioniert wie ich es mir vorgestellt habe muss nur noch hier und da ein wenig was verbessern
Danke an alle die halfen.
Nacht zusammen
ScarfacePH
Danke für die schnellen Antworten und ich denke es sollte funktionieren brauche aber noch etwas Zeit um das genau sagen zu können. Danke
MfG
Abend zusammen
Ich habe nun ein Scribt geschrieben welches eine .txt Datei auf dem Desktop ausliest.
Ich möchte aber das das Script alle Dateien in einem Ordner ausliest. Ich denk mal generell eine .txt Datei aus dem Ordner auszulesen sollte kein großes Problem darstellen aber wenn das Script mit der ersten .txt Datei Fertig ist die zweite .txt Datei ebenfalls auszulesen stellt sich für mich als Problem heraus.
MfG
ScarfacePH
Hab es nun ausprobiert angepasst und funktioniert 1a.
Dankeschön
MfG
ScarfacePH
Hallo zusammen!
Ich möchte aus einer .txt Zeile das dritte Wort auslesen. Hatte es mit Stringmid (...) versucht jedoch dann festgestellt dass, das Wort meistens verschieden lang ist. Und der Befehl soll für mehrere Zeilen funktionieren. Gibt es da vielleicht einen Befehl der von der zweiten Leerstelle bis zur dritten den Text auslesen kann?
MfG
ScarfacePH
Ja cool so funktioniert das genau richtig.
Einen Dank an die beiden Helfer
Weiß nicht genau bekomme noch dauernt Fehlermeldungen
hier mal eine schleife in der ich ansetzen möchte
If StringInStr($aRecords[$x], $erg1) Then
If $erg1 = $Sp0 Then
While 1
If StringInStr($aRecords[$x],$pl0) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl0) Then
$x = $x + 1
EndIf
WEnd
EndIf
EndIf
hab das dann mal so versucht funktioniert aber nicht ganz
If $erg1 = $Sp0 Then
While 1
If StringInStr($aRecords[$x],$pl0) Then
FileWriteLine($file, "3 |"& $aRecords[$x])
If _Main() Then
Func _Main()
Local $klammer = _StringBetween($aRecords[$x], '[', ']')
EndFunc ;==>_Main
FileWriteLine($file, "4 |"& _Main ())
EndIf
ExitLoop
EndIf
If not StringInStr($aRecords[$x],$pl0) Then
$x = $x + 1
EndIf
WEnd
EndIf
bitte um weiteren Rat
Hallo zusammen!
Und zwar habe ich eine Textdatei welche ich in Arrays auslese dabei entsehen mehrere Blöcke, alles funktioniert auch soweit.
Nun mein Problem, in manchen Blöcken kommt es vor das in einer Zeile zwei Wörter in Klammern stehen wie so z.B.: "Bla bla [p2 m4] bla bla bla" nun habe ich keinen Befehl gefunden mit welchem ich einen Text in einer Klammer auslesen kann. Die Position der Klammer in der Zeile ändert sich in den verschiedenen Blöcken und der Text innerhalb ebenfalls. Danke vorhinein
Mfg ScarfacePH
Ist nett gemeint Jonathan. Aber Guis sind gar nicht so schwer und mit dem ein und auslesen ist auch kein Ding wie gesagt. Ich bin noch ein Anfänger ja aber gerade falls ich etwas neues lernen kann was ich noch nicht kannte ist doch supi. Trotzdem danke für das Lob
MfG
Gefällt mir auch ganz gut. Werde demnächst dann mal eine Mischung der beiden Arten input und radio machen. Danke
Klasse funktioniert super. Finde ich spitze wie schnell du mir hier geholfen hast (vor allem wie gut)
cool danke an alle. Dann fange ich doch mal gleich an mich da durchzuarbeiten. Ihr habt mir super geholfen
Dann stellt sich nun nur noch die Frage wie es funktioniert das man nicht immer wieder das selbe Ergebnis abfragen/prüfen kann. Wäre toll wenn die nächste Aufgabe kommt sobald eine gelöst wurde. Weis da jemand vielleicht einen Ansatz?
Hab das mit der Pause geändert.
Cool danke für die Tipps werde mich da doch direkt mal durchlesen