dans le cadre de mon projet, je dois traquer certaines lignes en définissant un pattern , expression régulière pour mettre en couleur dans une listview les différentes lignes.
Fichier txt contient ce type de ligne :
J'ai réussi en autohotkey à une époque mais je n'y parviens pas en autoit.O42 - Logiciel: Adobe Flash Player 10 ActiveX - (.Adobe Systems Incorporated.) [HKLM] -- Adobe Flash Player ActiveX
O42 - Logiciel: Adobe Flash Player 10 Plugin - (.Adobe Systems Incorporated.) [HKLM] -- Adobe Flash Player Plugin
O42 - Logiciel: Adobe Reader 7.0.8 - Français - (.Adobe Systems Incorporated.) [HKLM] -- {AC76BA86-7AD7-1036-7B44-A70700000002}
O42 - Logiciel: Adobe Reader 9.4.1 - Français - (.Adobe Systems Incorporated.) [HKLM] -- {AC76BA86-7AD7-1036-7B44-A94000000001}
O42 - Logiciel: Adobe Shockwave Player 11.5 - (.Adobe Systems, Inc..) [HKLM] -- Adobe Shockwave Player
O42 - Logiciel: Assistant de connexion Windows Live - (.Microsoft Corporation.) [HKLM] -- {DCE8CD14-FBF5-4464-B9A4-E18E473546C7}
Tous les exemples trouvés reposent sur des pages html
y aurait il une personne pour m'expliquer mon erreur ?
Code : Tout sélectionner
$nOffset = 1
local $i
$array = StringRegExp('O42 - Logiciel: Adobe Reader 7.0.8 - Français - (.Adobe Systems Incorporated.) [HKLM] -- {AC76BA86-7AD7-1036-7B44-A70700000002}','^Adobe Reader [0-9\.]+',1, $nOffset)
for $i = 0 to UBound($array) - 1
If $array > 0 Then
msgbox("0","Old", $array[$i])
EndIf
Next
ConsoleWrite me met erreur, ou plusieurs 00000
Code : Tout sélectionner
$nOffset = 1
local $i
$OpenDialog = "file.txt"
$file = FileOpen($OpenDialog, 0)
While 1
$ligne = FileReadLine($file) ; ou on lit une ligne
If @error = -1 Then ExitLoop
$array = StringRegExp($ligne,'^Adobe Reader [0-9\.]+',1, $nOffset)
If $array > 0 Then
for $i = 0 to UBound($array) - 1
msgbox("0","Old", $array[$i])
Next
EndIf
ConsoleWrite($array[$i])
WEnd
FileClose($file)
Laddy



