Bonjour à tous,

j'ai un bout de code tout simple :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Set objFS = CreateObject("Scripting.FileSystemObject")
'File to scan
strFile = "D:\myfile.log"
'Pattern to search for, eg Hallo
strPattern = "Source"
Set objFile = objFS.OpenTextFile(strFile)
strLine = objFile.ReadAll
Do Until objFile.AtEndOfStream
    strLine = objFile.ReadAll
    If InStr(strLine,strPattern)>0 Then
        WScript.Echo strLine
                H=strLine
    End If
wscript.echo H	
Loop
 
 
wscript.echo strLine
c'est assez particulier, ça m'affiche des caractères bizarres du style :
"ÿba". Alors que mon fichier de log fait plusieurs lignes. Y a - t - il une option pour de l'unicode ou autre ? Il doit y a avoir un caractére bidon qui ressemble à un "EndOfStream" et du coup ma boucle s'arrête.

des idées ?

Merci
Olivier