Help me lecture de fichiers .log avec vbs

cs_tilteur Messages postés 8 Date d'inscription jeudi 13 novembre 2003 Statut Membre Dernière intervention 20 novembre 2003 - 13 nov. 2003 à 14:01
cs_tilteur Messages postés 8 Date d'inscription jeudi 13 novembre 2003 Statut Membre Dernière intervention 20 novembre 2003 - 14 nov. 2003 à 11:41
tout est di dan le sujet.
jaimerai savoir comment on fè pour lire un fichier et regarder s'il n'y a pa le mot échec dedans
répondez moi merci.

3 réponses

cs_radada Messages postés 488 Date d'inscription lundi 15 septembre 2003 Statut Membre Dernière intervention 21 avril 2009 1
13 nov. 2003 à 20:25
Ben ouvre ton fichier en lecture comme ça
    Open CMD.FileName For Input As #1
    Line Input #1, texte
    tout = texte
    While Not EOF(1)
        Line Input #1, texte
        tout = tout & vbCrLf & texte
    Wend


Pour rechercher ton texte, je pense qu'en utilisant la fonction Filter :

Description

Returns a zero-based array containing subset of a string array based on a specified filter criteria.

Syntax

Filter(InputStrings, Value[, Include[, Compare]])

The Filter function syntax has these parts:

Part Description
InputStrings Required. One-dimensional array of strings to be searched.
Value Required. String to search for.
Include Optional. Boolean value indicating whether to return substrings that include or exclude Value. If Include is True, Filter returns the subset of the array that contains Value as a substring. If Include is False, Filter returns the subset of the array that does not contain Value as a substring.
Compare Optional. Numeric value indicating the kind of string comparison to use. See Settings section for values.

Settings

The Compare argument can have the following values:

Constant Value Description
vbUseCompareOption –1 Performs a comparison using the setting of the Option Compare statement.
vbBinaryCompare 0 Performs a binary comparison.
vbTextCompare 1 Performs a textual comparison.
vbDatabaseCompare 2 Microsoft Access only. Performs a comparison based on information in your database.

Remarks

If no matches of Value are found within InputStrings, Filter returns an empty array. An error occurs if InputStrings is Null or is not a one-dimensional array.

The array returned by the Filter function contains only enough elements to contain the number of matched items.

Bon courage : )
0
cs_tilteur Messages postés 8 Date d'inscription jeudi 13 novembre 2003 Statut Membre Dernière intervention 20 novembre 2003
14 nov. 2003 à 11:36
g oublié de précisé mai san ouvrir le fichier sinon c facil
merci can mem pour ta réponse radada
0
cs_tilteur Messages postés 8 Date d'inscription jeudi 13 novembre 2003 Statut Membre Dernière intervention 20 novembre 2003
14 nov. 2003 à 11:41
g oublié de précisé mai san ouvrir le fichier sinon c facil
merci can mem pour ta réponse radada
0
Rejoignez-nous