Extraire un mot dans un fichier texte

Résolu
syphax55 Messages postés 35 Date d'inscription   Statut Membre Dernière intervention   -  
syphax55 Messages postés 35 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
je veux extraire un mot du ligne parcouru.comment faire
voila mon code

Private Sub ouvrir_Click()
On Error Resume Next
Open "C:\Windows\Bureau\note.TXT" For Input As #1
retour = Chr$(13) + Chr$(10)
Line Input #1, texte
tout = texte
If Len(tout) <> 0 Then
While Not EOF(1)
Line Input #1, texte
tout = tout + retour + texte
Wend
End If
Close #1
End Sub


A voir également:

1 réponse

joomliner Messages postés 89 Date d'inscription   Statut Membre Dernière intervention   36
 
Bonjour

Quelle version de VB utilisez-vous ?

La fonction InStr est toute dévouée pour cette tâche.

Exemple: https://silkyroad.developpez.com/VBA/ManipulerChainesCaracteres/#LI-E

Bon succès,
0
syphax55 Messages postés 35 Date d'inscription   Statut Membre Dernière intervention  
 
merci beaucoup. très suffisant l'exemple.
0