Super es funktioniert. Hab mich für die StringRegExp Version entschieden, konnte ich einfacher einfügen und weiterverarbeiten. Danke für eure Hilfe. Ich werde dieses "StringRegExp" nie verstehen.
Danke nochmal und Gruß
Klaus
Super es funktioniert. Hab mich für die StringRegExp Version entschieden, konnte ich einfacher einfügen und weiterverarbeiten. Danke für eure Hilfe. Ich werde dieses "StringRegExp" nie verstehen.
Danke nochmal und Gruß
Klaus
Nein es kommt nichts mehr. Die Problembeschreibung ist der letzte Eintrag.
Ja genau. Manchmal steht der Text direkt hinter "Problem:" und manchmal erst in der nächsten Zeile.
Es ist immer eine Problembeschreibung pro Datei. Danach kommt nichts mehr.
Hallo,
Danke für die schnelle Hilfe.
Mit "StringRegExp" habe ich es schon versucht. Funktioniert normalerweise auch, jedenfalls bei den anderen Informationen aus der Datei, aber der User ist das Problem.
Diese .txt ist eine Fehlerbeschreibung mit einer festen Formatierung. Leider halten sich die meisten nicht an diese und die Problembeschreibung wird mal in die gleiche Zeile geschrieben, mal in die nächste und manchmal werden zwischen den ersten 3 Zeilen und der Problembeschreibung neue Zeilen eingefügt.
Meine Idee war es nun, herauszufinden in welcher Zeile sich das Wort "Problem:" befindet und einfach die nächsten
3 Zeilen mit "FileReadLine" auszulesen. Länger ist die Beschreibung nicht, meisten nur ein Satz.
Hallo zusammen,
ich brauche mal wieder etwas hilfe:
Habe eine .txt mit ein paar Werten z.B.:
--------------------------
12345_33
adbarjz
123.112.122.121
Problem: jjfhsjhfjkh
--------------------------
Die ersten Werte auszulesen habe ich hinbekommen, leider steht die Problembeschreibung nicht immer in der gleichen zeile.
Nun möchte ich wissen in welcher Zeile "Problem..." steht und diese in eine Variable schreiben.
Ich habe die Hilfe mal durchforstet, aber leider nicht das richtige gefunden.
Vielleicht könnt ihr mir mal einen Tipp geben.
Danke&Gruß
Klaus
Hallo autoBert
funktoniert super. Vielen Dank.
Ich hab irgendwann wohl die Übersicht verloren.
Vielen Dank nochmal und Gruß
Klaus
Hallo Zusammen,
Ich bin leider noch nicht so erfahren mit AutoIT und habe versucht einen Timer zu "basteln".
Ich habe ein gutes Beispiel gefunden und es für mich angepasst. Funktionierte soweit ganz gut.
Ich brauche aber mindestens 2 Timer, die ablaufen.
Meine Frage nun:
Kann man auch 2 Timer gleichzeitig ablaufen lassen?
Ich habe es mir mal einfach gemacht und mein Script kopiert. Die Variablen habe ich natürlich
angepasst. Aber leider hat es damit nicht funktioniert. Es läuft immer nur der zweite ab.
Vielleicht Könnt Ihr mir helfen.
Danke.
Klaus
#include
#include
#include
#include
#include
#include
Global Const $hGUI = GUICreate("Timer", 720, 300)
GUISetBkColor(0xA6CAF0)
GuiCtrlCreateGroup("Timer", 4, 4, 480, 150)
[/autoit] [autoit][/autoit] [autoit]Global Const $idLableStd = GUICtrlCreateLabel("Std", 10, 18, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global $idInputStd = GUICtrlCreateInput("1", 8, 35, 40, 20, BitOR($ES_CENTER,$ES_NUMBER))
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idUpdownStd = GUICtrlCreateUpdown($idInputStd)
GUICtrlSetLimit(-1, 999, 0)
Global Const $idLableDP1 = GUICtrlCreateLabel(":", 58, 35, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idLableMin = GUICtrlCreateLabel("Min", 70, 18, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global $idInputMin = GUICtrlCreateInput("0", 68, 35, 40, 20, BitOR($ES_CENTER,$ES_NUMBER))
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idUpdownMin = GUICtrlCreateUpdown($idInputMin)
GUICtrlSetLimit(-1, 59, 0)
Global Const $idLableDP2 = GUICtrlCreateLabel(":", 118, 35, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idLableSec = GUICtrlCreateLabel("Sec", 130, 18, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global $idInputSek = GUICtrlCreateInput("0", 128, 35, 40, 20, BitOR($ES_CENTER,$ES_NUMBER))
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idUpdownSek = GUICtrlCreateUpdown($idInputSek)
GUICtrlSetLimit(-1, 59, 0)
; 2 Timer
Global $idInputStd1 = GUICtrlCreateInput("1", 8, 65, 40, 20, BitOR($ES_CENTER,$ES_NUMBER))
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idUpdownStd1 = GUICtrlCreateUpdown($idInputStd1)
GUICtrlSetLimit(-1, 999, 0)
Global Const $idLableDP11 = GUICtrlCreateLabel(":", 58, 65, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global $idInputMin1 = GUICtrlCreateInput("0", 68, 65, 40, 20, BitOR($ES_CENTER,$ES_NUMBER))
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idUpdownMin1 = GUICtrlCreateUpdown($idInputMin1)
GUICtrlSetLimit(-1, 59, 0)
Global Const $idLableDP21 = GUICtrlCreateLabel(":", 118, 65, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global $idInputSek1 = GUICtrlCreateInput("0", 128, 65, 40, 20, BitOR($ES_CENTER,$ES_NUMBER))
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idUpdownSek1 = GUICtrlCreateUpdown($idInputSek1)
GUICtrlSetLimit(-1, 59, 0)
Global Const $idButtonStart = GUICtrlCreateButton("Start", 178, 35, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idButtonStop = GUICtrlCreateButton("Stop", 228, 35, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
GUICtrlSetState(-1, $GUI_DISABLE)
Global Const $idButtonReset = GUICtrlCreateButton("Reset", 278, 35, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
GUICtrlSetState(-1, $GUI_DISABLE)
;2 Timer
Global Const $idButtonStart1 = GUICtrlCreateButton("Start", 178, 65, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
Global Const $idButtonStop1 = GUICtrlCreateButton("Stop", 228, 65, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
GUICtrlSetState(-1, $GUI_DISABLE)
Global Const $idButtonReset1 = GUICtrlCreateButton("Reset", 278, 65, 40, 20)
GUICtrlSetFont(-1, 10, 10, 0, "Times New Roman")
GUICtrlSetState(-1, $GUI_DISABLE)
;Inputfelder
Global $idTicket = GUICtrlCreateInput("Ticket-ID", 338, 35, 120, 20)
GUICtrlSetFont(-1, 10, 10, 1, "Times New Roman")
Global $idTicket1 = GUICtrlCreateInput("Ticket-ID", 338, 65, 120, 20)
GUICtrlSetFont(-1, 10, 10, 1, "Times New Roman")
GUISetState(@SW_SHOW)
[/autoit] [autoit][/autoit] [autoit]ControlFocus("", "", $idButtonStart)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Global $nMsg, $seconds, $seconds2
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $idButtonStart
$seconds = GUICtrlRead($idInputStd) * 60^2 + GUICtrlRead($idInputMin) * 60 + GUICtrlRead($idInputSek) - 1
If $seconds > 0 Then
GUICtrlSetState($idButtonStart, $GUI_DISABLE)
GUICtrlSetState($idButtonStart, $GUI_DISABLE)
GUICtrlSetState($idUpdownStd, $GUI_DISABLE)
GUICtrlSetState($idUpdownMin, $GUI_DISABLE)
GUICtrlSetState($idUpdownSek, $GUI_DISABLE)
GUICtrlSetState($idButtonStop, $GUI_ENABLE)
AdlibRegister("Countdown1", 1000)
EndIf
Case $idButtonStart1 ; 2 Reihe
$seconds1 = GUICtrlRead($idInputStd1) * 60^2 + GUICtrlRead($idInputMin1) * 60 + GUICtrlRead($idInputSek1) - 1
If $seconds1 > 0 Then
GUICtrlSetState($idButtonStart1, $GUI_DISABLE)
GUICtrlSetState($idButtonStart1, $GUI_DISABLE)
GUICtrlSetState($idUpdownStd1, $GUI_DISABLE)
GUICtrlSetState($idUpdownMin1, $GUI_DISABLE)
GUICtrlSetState($idUpdownSek1, $GUI_DISABLE)
GUICtrlSetState($idButtonStop1, $GUI_ENABLE)
AdlibRegister("Countdown2", 1000)
EndIf
Case $idButtonStop
AdlibUnRegister("Countdown1")
GUICtrlSetState($idButtonStart, $GUI_ENABLE)
GUICtrlSetState($idButtonReset, $GUI_ENABLE)
GUICtrlSetState($idUpdownStd, $GUI_ENABLE)
GUICtrlSetState($idUpdownMin, $GUI_ENABLE)
GUICtrlSetState($idUpdownSek, $GUI_ENABLE)
GUICtrlSetState($idButtonStop, $GUI_DISABLE)
Case $idButtonStop1 ;2 Timer
AdlibUnRegister("Countdown2")
GUICtrlSetState($idButtonStart1, $GUI_ENABLE)
GUICtrlSetState($idButtonReset1, $GUI_ENABLE)
GUICtrlSetState($idUpdownStd1, $GUI_ENABLE)
GUICtrlSetState($idUpdownMin1, $GUI_ENABLE)
GUICtrlSetState($idUpdownSek1, $GUI_ENABLE)
GUICtrlSetState($idButtonStop1, $GUI_DISABLE)
Case $idButtonReset
GUICtrlSetData($idInputStd,1)
GUICtrlSetData($idInputMin,0)
GUICtrlSetData($idInputSek,0)
Case $idButtonReset1 ; 2 Timer
GUICtrlSetData($idInputStd1,1)
GUICtrlSetData($idInputMin1,0)
GUICtrlSetData($idInputSek1,0)
EndSwitch
WEnd
Func Countdown1()
Local $sec, $min, $hr
$sec = Mod($seconds, 60)
$min = Mod($seconds / 60, 60)
$hr = Floor($seconds / 60 ^ 2)
GUICtrlSetData($idInputStd1, StringFormat("i", $hr))
GUICtrlSetData($idInputMin1, StringFormat("i", $min))
GUICtrlSetData($idInputSek1, StringFormat("i", $sec))
If $seconds <= 0 Then
AdlibUnRegister("Countdown1")
$Ticket = GUICtrlRead($idTicket)
MsgBox(0, "Timer", "Für das Ticket "&$Ticket&" muß eine Mail verschickt werden")
;Exit
EndIf
$seconds -= 1
EndFunc
Func Countdown2()
Local $sec1, $min1, $hr1
$sec1 = Mod($seconds1, 60)
$min1 = Mod($seconds1 / 60, 60)
$hr1 = Floor($seconds1 / 60 ^ 2)
GUICtrlSetData($idInputStd1, StringFormat("i", $hr1))
GUICtrlSetData($idInputMin1, StringFormat("i", $min1))
GUICtrlSetData($idInputSek1, StringFormat("i", $sec1))
If $seconds1 <= 0 Then
AdlibUnRegister("Countdown2")
$Ticket1 = GUICtrlRead($idTicket1)
MsgBox(0, "Timer2", "Für das Ticket "&$Ticket1&" muß eine Mail verschickt werden")
;Exit
EndIf
$seconds1 -= 1
EndFunc