Existe t'il une API Windows ou une m=E9thode qui permet de=20
lire une ligne dans un fichier texte ouvert par l'API=20
CreateFileEx (=E0 l'image de la m=E9thode ReadLine d'un objet=20
TextStream) ?
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
ng
Salut,
Essaye ceci :
Dim k As Integer, strBuff As String, tblLignes() As String k = FreeFile Open "c:1.txt" For Binary As #k strBuff = String$(LOF(k), vbNulChar) Get #k, , strBuff Close #k tblLignes = Split(strBuff, vbCrLf): strBuff = "" For k = 0 To UBound(tblLignes) MsgBox tblLignes(k) Next
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Jean Saint Jalmes a écrit :
Bonjour,
Existe t'il une API Windows ou une méthode qui permet de lire une ligne dans un fichier texte ouvert par l'API CreateFileEx (à l'image de la méthode ReadLine d'un objet TextStream) ?
Merci par avance.
Jean
Salut,
Essaye ceci :
Dim k As Integer, strBuff As String, tblLignes() As String
k = FreeFile
Open "c:1.txt" For Binary As #k
strBuff = String$(LOF(k), vbNulChar)
Get #k, , strBuff
Close #k
tblLignes = Split(strBuff, vbCrLf): strBuff = ""
For k = 0 To UBound(tblLignes)
MsgBox tblLignes(k)
Next
--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/
Jean Saint Jalmes <anonymous@discussions.microsoft.com> a écrit :
Bonjour,
Existe t'il une API Windows ou une méthode qui permet de
lire une ligne dans un fichier texte ouvert par l'API
CreateFileEx (à l'image de la méthode ReadLine d'un objet
TextStream) ?
Dim k As Integer, strBuff As String, tblLignes() As String k = FreeFile Open "c:1.txt" For Binary As #k strBuff = String$(LOF(k), vbNulChar) Get #k, , strBuff Close #k tblLignes = Split(strBuff, vbCrLf): strBuff = "" For k = 0 To UBound(tblLignes) MsgBox tblLignes(k) Next
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Jean Saint Jalmes a écrit :
Bonjour,
Existe t'il une API Windows ou une méthode qui permet de lire une ligne dans un fichier texte ouvert par l'API CreateFileEx (à l'image de la méthode ReadLine d'un objet TextStream) ?
Merci par avance.
Jean
J'utilise déjà cette méthode avec des petits fichiers mais elle ne convient pas aux très gros fichiers (plusieurs méga octets)
-----Message d'origine----- Salut,
Essaye ceci :
Dim k As Integer, strBuff As String, tblLignes() As String k = FreeFile Open "c:1.txt" For Binary As #k strBuff = String$(LOF(k), vbNulChar) Get #k, , strBuff Close #k tblLignes = Split(strBuff, vbCrLf): strBuff = "" For k = 0 To UBound(tblLignes) MsgBox tblLignes(k) Next
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Jean Saint Jalmes a
écrit :
Bonjour,
Existe t'il une API Windows ou une méthode qui permet de lire une ligne dans un fichier texte ouvert par l'API CreateFileEx (à l'image de la méthode ReadLine d'un
objet
TextStream) ?
Merci par avance.
Jean
.
J'utilise déjà cette méthode avec des petits fichiers mais
elle ne convient pas aux très gros fichiers (plusieurs
méga octets)
-----Message d'origine-----
Salut,
Essaye ceci :
Dim k As Integer, strBuff As String, tblLignes() As String
k = FreeFile
Open "c:1.txt" For Binary As #k
strBuff = String$(LOF(k), vbNulChar)
Get #k, , strBuff
Close #k
tblLignes = Split(strBuff, vbCrLf): strBuff = ""
For k = 0 To UBound(tblLignes)
MsgBox tblLignes(k)
Next
--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/
Jean Saint Jalmes <anonymous@discussions.microsoft.com> a
écrit :
Bonjour,
Existe t'il une API Windows ou une méthode qui permet de
lire une ligne dans un fichier texte ouvert par l'API
CreateFileEx (à l'image de la méthode ReadLine d'un
J'utilise déjà cette méthode avec des petits fichiers mais elle ne convient pas aux très gros fichiers (plusieurs méga octets)
-----Message d'origine----- Salut,
Essaye ceci :
Dim k As Integer, strBuff As String, tblLignes() As String k = FreeFile Open "c:1.txt" For Binary As #k strBuff = String$(LOF(k), vbNulChar) Get #k, , strBuff Close #k tblLignes = Split(strBuff, vbCrLf): strBuff = "" For k = 0 To UBound(tblLignes) MsgBox tblLignes(k) Next
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Jean Saint Jalmes a
écrit :
Bonjour,
Existe t'il une API Windows ou une méthode qui permet de lire une ligne dans un fichier texte ouvert par l'API CreateFileEx (à l'image de la méthode ReadLine d'un
objet
TextStream) ?
Merci par avance.
Jean
.
ng
Bonjour,
Ah bon et pourquoi ? Je l'utilise aussi pour des fichiers très important, c'est bcp plus rapide que du Line Input...
Sinon regardez du coté du file mapping...
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
a écrit :
J'utilise déjà cette méthode avec des petits fichiers mais elle ne convient pas aux très gros fichiers (plusieurs méga octets)
-----Message d'origine----- Salut,
Essaye ceci :
Dim k As Integer, strBuff As String, tblLignes() As String k = FreeFile Open "c:1.txt" For Binary As #k strBuff = String$(LOF(k), vbNulChar) Get #k, , strBuff Close #k tblLignes = Split(strBuff, vbCrLf): strBuff = "" For k = 0 To UBound(tblLignes) MsgBox tblLignes(k) Next
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Jean Saint Jalmes a écrit :
Bonjour,
Existe t'il une API Windows ou une méthode qui permet de lire une ligne dans un fichier texte ouvert par l'API CreateFileEx (à l'image de la méthode ReadLine d'un objet TextStream) ?
Merci par avance.
Jean
.
Bonjour,
Ah bon et pourquoi ?
Je l'utilise aussi pour des fichiers très important, c'est bcp plus rapide
que du Line Input...
Sinon regardez du coté du file mapping...
--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/
anonymous@discussions.microsoft.com <anonymous@discussions.microsoft.com> a
écrit :
J'utilise déjà cette méthode avec des petits fichiers mais
elle ne convient pas aux très gros fichiers (plusieurs
méga octets)
-----Message d'origine-----
Salut,
Essaye ceci :
Dim k As Integer, strBuff As String, tblLignes() As String
k = FreeFile
Open "c:1.txt" For Binary As #k
strBuff = String$(LOF(k), vbNulChar)
Get #k, , strBuff
Close #k
tblLignes = Split(strBuff, vbCrLf): strBuff = ""
For k = 0 To UBound(tblLignes)
MsgBox tblLignes(k)
Next
--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/
Jean Saint Jalmes <anonymous@discussions.microsoft.com> a écrit :
Bonjour,
Existe t'il une API Windows ou une méthode qui permet de
lire une ligne dans un fichier texte ouvert par l'API
CreateFileEx (à l'image de la méthode ReadLine d'un objet
TextStream) ?
Ah bon et pourquoi ? Je l'utilise aussi pour des fichiers très important, c'est bcp plus rapide que du Line Input...
Sinon regardez du coté du file mapping...
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
a écrit :
J'utilise déjà cette méthode avec des petits fichiers mais elle ne convient pas aux très gros fichiers (plusieurs méga octets)
-----Message d'origine----- Salut,
Essaye ceci :
Dim k As Integer, strBuff As String, tblLignes() As String k = FreeFile Open "c:1.txt" For Binary As #k strBuff = String$(LOF(k), vbNulChar) Get #k, , strBuff Close #k tblLignes = Split(strBuff, vbCrLf): strBuff = "" For k = 0 To UBound(tblLignes) MsgBox tblLignes(k) Next
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Jean Saint Jalmes a écrit :
Bonjour,
Existe t'il une API Windows ou une méthode qui permet de lire une ligne dans un fichier texte ouvert par l'API CreateFileEx (à l'image de la méthode ReadLine d'un objet TextStream) ?