Extraire une portion de texte dans un fichier texte (*.txt)

sebmaurice - 31 mai 2001 à 19:04
 int19h - 31 mai 2001 à 20:50
Bonjour

Comment, sous VB 5 Pro, puis-je extraire une portion de fichier texte à partir d'un fichier .txt (fonction similaire à "grep" sous Unix) ?

Merci d'avance pour votre réponse si vous pouvez le faire.

1 réponse

Je connais pas la fonction "grep" de Unix. Mail moi (en direct) plus d'info.

Mais voila un debut :

a$="ce que tu cherche"

close
open "fichier.txt" for input as #1
b$=input$(lof(1),#1)
close

if instr(ucase$(b$),ucase$(a$)) <> 0 then
Msgbox "Chaine trouver position : " & instr(ucase$(b$),ucase$(a$))
end if

Question : Int19h@usa.net

a+

int19h
0
Rejoignez-nous