voila le fichier "domains"
dont je veut prendre chaque ligne pour en faire un fichier xml comme
mon code tout simple :
Private Sub Form_Load()
Dim ligne_R As String
Dim ligne_W As String
Dim var1 As String
'ModuleF.verifyFile ("/warez/domains")
var1 = """"
Open "domains" For Input As #1
Open "domain2add.xml" For Output As #2
If Err Then
MsgBox "Impossible de creer le fichier !"
Else
'header du fichier
Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
".-->"
Do While Not EOF(1)
Line Input #1, ligne_R
Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName=" & var1
"*" & ligne_R & var1 & " Path=" & var1 & "/" & var1 & ">"
Loop
'footer du fichier
Print #2, "</ads>"
Close #2 'Fermeture du fichier.
End If
"Zoury" a écrit dans le message de news:
> Salut! :O)
>
> Peut-on voir le code!?
>
> --
> Cordialement
> Yanick Lefebvre - MVP pour Visual Basic
> http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
> http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
>
>
voila le fichier "domains"
dont je veut prendre chaque ligne pour en faire un fichier xml comme
mon code tout simple :
Private Sub Form_Load()
Dim ligne_R As String
Dim ligne_W As String
Dim var1 As String
'ModuleF.verifyFile ("/warez/domains")
var1 = """"
Open "domains" For Input As #1
Open "domain2add.xml" For Output As #2
If Err Then
MsgBox "Impossible de creer le fichier !"
Else
'header du fichier
Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
".-->"
Do While Not EOF(1)
Line Input #1, ligne_R
Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName=" & var1
"*" & ligne_R & var1 & " Path=" & var1 & "/" & var1 & ">"
Loop
'footer du fichier
Print #2, "</ads>"
Close #2 'Fermeture du fichier.
End If
"Zoury" <yanick_lefebvre@hotmail.com> a écrit dans le message de news:
OPWMtSYgDHA.632@TK2MSFTNGP10.phx.gbl...
> Salut! :O)
>
> Peut-on voir le code!?
>
> --
> Cordialement
> Yanick Lefebvre - MVP pour Visual Basic
> http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
> http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
>
>
voila le fichier "domains"
dont je veut prendre chaque ligne pour en faire un fichier xml comme
mon code tout simple :
Private Sub Form_Load()
Dim ligne_R As String
Dim ligne_W As String
Dim var1 As String
'ModuleF.verifyFile ("/warez/domains")
var1 = """"
Open "domains" For Input As #1
Open "domain2add.xml" For Output As #2
If Err Then
MsgBox "Impossible de creer le fichier !"
Else
'header du fichier
Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
".-->"
Do While Not EOF(1)
Line Input #1, ligne_R
Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName=" & var1
"*" & ligne_R & var1 & " Path=" & var1 & "/" & var1 & ">"
Loop
'footer du fichier
Print #2, "</ads>"
Close #2 'Fermeture du fichier.
End If
"Zoury" a écrit dans le message de news:
> Salut! :O)
>
> Peut-on voir le code!?
>
> --
> Cordialement
> Yanick Lefebvre - MVP pour Visual Basic
> http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
> http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
>
>
Voici le code :
Option Explicit
Private Sub Form_Load()
Dim ligne_R As String
Dim ligne_W As String
Dim var1 As String
Dim a() As String, i%
'ModuleF.verifyFile ("/warez/domains")
var1 = """"
Open "domains.dat" For Input As #1
Open "domain2add.xml" For Output As #2
If Err Then
MsgBox "Impossible de creer le fichier !"
Else
'header du fichier
Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
".-->"
Line Input #1, ligne_R
a = Split(ligne_R, Chr(10))
For i% = 1 To UBound(a)
Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName="
var1 & "*" & a(i%) & var1 & " Path=" & var1 & "/" & var1 & ">"
Next i%
'footer du fichier
Print #2, "</ads>"
Close #2 'Fermeture du fichier.
End If
End Sub
André
Voici le code :
Option Explicit
Private Sub Form_Load()
Dim ligne_R As String
Dim ligne_W As String
Dim var1 As String
Dim a() As String, i%
'ModuleF.verifyFile ("/warez/domains")
var1 = """"
Open "domains.dat" For Input As #1
Open "domain2add.xml" For Output As #2
If Err Then
MsgBox "Impossible de creer le fichier !"
Else
'header du fichier
Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
".-->"
Line Input #1, ligne_R
a = Split(ligne_R, Chr(10))
For i% = 1 To UBound(a)
Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName="
var1 & "*" & a(i%) & var1 & " Path=" & var1 & "/" & var1 & ">"
Next i%
'footer du fichier
Print #2, "</ads>"
Close #2 'Fermeture du fichier.
End If
End Sub
André
Voici le code :
Option Explicit
Private Sub Form_Load()
Dim ligne_R As String
Dim ligne_W As String
Dim var1 As String
Dim a() As String, i%
'ModuleF.verifyFile ("/warez/domains")
var1 = """"
Open "domains.dat" For Input As #1
Open "domain2add.xml" For Output As #2
If Err Then
MsgBox "Impossible de creer le fichier !"
Else
'header du fichier
Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
".-->"
Line Input #1, ligne_R
a = Split(ligne_R, Chr(10))
For i% = 1 To UBound(a)
Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName="
var1 & "*" & a(i%) & var1 & " Path=" & var1 & "/" & var1 & ">"
Next i%
'footer du fichier
Print #2, "</ads>"
Close #2 'Fermeture du fichier.
End If
End Sub
André
voila le fichier "domains"
dont je veut prendre chaque ligne pour en faire un fichier xml comme
mon code tout simple :
Private Sub Form_Load()
Dim ligne_R As String
Dim ligne_W As String
Dim var1 As String
'ModuleF.verifyFile ("/warez/domains")
var1 = """"
Open "domains" For Input As #1
Open "domain2add.xml" For Output As #2
If Err Then
MsgBox "Impossible de creer le fichier !"
Else
'header du fichier
Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
".-->"
Do While Not EOF(1)
Line Input #1, ligne_R
Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName=" & var1
"*" & ligne_R & var1 & " Path=" & var1 & "/" & var1 & ">"
Loop
'footer du fichier
Print #2, "</ads>"
Close #2 'Fermeture du fichier.
End If
"Zoury" a écrit dans le message de news:
> Salut! :O)
>
> Peut-on voir le code!?
>
> --
> Cordialement
> Yanick Lefebvre - MVP pour Visual Basic
> http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
> http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
>
>
voila le fichier "domains"
dont je veut prendre chaque ligne pour en faire un fichier xml comme
mon code tout simple :
Private Sub Form_Load()
Dim ligne_R As String
Dim ligne_W As String
Dim var1 As String
'ModuleF.verifyFile ("/warez/domains")
var1 = """"
Open "domains" For Input As #1
Open "domain2add.xml" For Output As #2
If Err Then
MsgBox "Impossible de creer le fichier !"
Else
'header du fichier
Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
".-->"
Do While Not EOF(1)
Line Input #1, ligne_R
Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName=" & var1
"*" & ligne_R & var1 & " Path=" & var1 & "/" & var1 & ">"
Loop
'footer du fichier
Print #2, "</ads>"
Close #2 'Fermeture du fichier.
End If
"Zoury" <yanick_lefebvre@hotmail.com> a écrit dans le message de news:
OPWMtSYgDHA.632@TK2MSFTNGP10.phx.gbl...
> Salut! :O)
>
> Peut-on voir le code!?
>
> --
> Cordialement
> Yanick Lefebvre - MVP pour Visual Basic
> http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
> http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
>
>
voila le fichier "domains"
dont je veut prendre chaque ligne pour en faire un fichier xml comme
mon code tout simple :
Private Sub Form_Load()
Dim ligne_R As String
Dim ligne_W As String
Dim var1 As String
'ModuleF.verifyFile ("/warez/domains")
var1 = """"
Open "domains" For Input As #1
Open "domain2add.xml" For Output As #2
If Err Then
MsgBox "Impossible de creer le fichier !"
Else
'header du fichier
Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
".-->"
Do While Not EOF(1)
Line Input #1, ligne_R
Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName=" & var1
"*" & ligne_R & var1 & " Path=" & var1 & "/" & var1 & ">"
Loop
'footer du fichier
Print #2, "</ads>"
Close #2 'Fermeture du fichier.
End If
"Zoury" a écrit dans le message de news:
> Salut! :O)
>
> Peut-on voir le code!?
>
> --
> Cordialement
> Yanick Lefebvre - MVP pour Visual Basic
> http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
> http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
>
>
"André Joubert" a écrit dans le message de
news:n0kcb.2935$
> Voici le code :
>
> Option Explicit
>
> Private Sub Form_Load()
>
> Dim ligne_R As String
> Dim ligne_W As String
> Dim var1 As String
> Dim a() As String, i%
>
> 'ModuleF.verifyFile ("/warez/domains")
> var1 = """"
>
> Open "domains.dat" For Input As #1
>
> Open "domain2add.xml" For Output As #2
>
> If Err Then
> MsgBox "Impossible de creer le fichier !"
> Else
> 'header du fichier
> Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
> ".-->"
>
>
> Line Input #1, ligne_R
> a = Split(ligne_R, Chr(10))
>
> For i% = 1 To UBound(a)
>
> Print #2, "<Destination Type=" & var1 & "0" & var1 & "
&
> var1 & "*" & a(i%) & var1 & " Path=" & var1 & "/" & var1 & ">"
>
> Next i%
>
> 'footer du fichier
> Print #2, "</ads>"
>
> Close #2 'Fermeture du fichier.
> End If
> End Sub
>
> André
>
Bonjour,
Ce code fonctionnera sur des petits fichiers ... Mais si vous attaquez des
fichiers de plusieurs Mo, il faudra envisager d'ecrire une proc de lecture
en mode binary avec dimensionnement d'un buffer, etc ... En effet, sur un
fichier de plusieurs Mo, lors du 'line input' la variable de destination
remplira avec l'ensemble du fichier puisque la rupture de remplissage se
fait à partir de '0D' (CR - Carriage Return) !
Cdlt,
"André Joubert" <jaji92@sympatico.ca> a écrit dans le message de
news:n0kcb.2935$PT3.442372@news20.bellglobal.com...
> Voici le code :
>
> Option Explicit
>
> Private Sub Form_Load()
>
> Dim ligne_R As String
> Dim ligne_W As String
> Dim var1 As String
> Dim a() As String, i%
>
> 'ModuleF.verifyFile ("/warez/domains")
> var1 = """"
>
> Open "domains.dat" For Input As #1
>
> Open "domain2add.xml" For Output As #2
>
> If Err Then
> MsgBox "Impossible de creer le fichier !"
> Else
> 'header du fichier
> Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
> ".-->"
>
>
> Line Input #1, ligne_R
> a = Split(ligne_R, Chr(10))
>
> For i% = 1 To UBound(a)
>
> Print #2, "<Destination Type=" & var1 & "0" & var1 & "
&
> var1 & "*" & a(i%) & var1 & " Path=" & var1 & "/" & var1 & ">"
>
> Next i%
>
> 'footer du fichier
> Print #2, "</ads>"
>
> Close #2 'Fermeture du fichier.
> End If
> End Sub
>
> André
>
Bonjour,
Ce code fonctionnera sur des petits fichiers ... Mais si vous attaquez des
fichiers de plusieurs Mo, il faudra envisager d'ecrire une proc de lecture
en mode binary avec dimensionnement d'un buffer, etc ... En effet, sur un
fichier de plusieurs Mo, lors du 'line input' la variable de destination
remplira avec l'ensemble du fichier puisque la rupture de remplissage se
fait à partir de '0D' (CR - Carriage Return) !
Cdlt,
"André Joubert" a écrit dans le message de
news:n0kcb.2935$
> Voici le code :
>
> Option Explicit
>
> Private Sub Form_Load()
>
> Dim ligne_R As String
> Dim ligne_W As String
> Dim var1 As String
> Dim a() As String, i%
>
> 'ModuleF.verifyFile ("/warez/domains")
> var1 = """"
>
> Open "domains.dat" For Input As #1
>
> Open "domain2add.xml" For Output As #2
>
> If Err Then
> MsgBox "Impossible de creer le fichier !"
> Else
> 'header du fichier
> Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
> ".-->"
>
>
> Line Input #1, ligne_R
> a = Split(ligne_R, Chr(10))
>
> For i% = 1 To UBound(a)
>
> Print #2, "<Destination Type=" & var1 & "0" & var1 & "
&
> var1 & "*" & a(i%) & var1 & " Path=" & var1 & "/" & var1 & ">"
>
> Next i%
>
> 'footer du fichier
> Print #2, "</ads>"
>
> Close #2 'Fermeture du fichier.
> End If
> End Sub
>
> André
>
Bonjour,
Ce code fonctionnera sur des petits fichiers ... Mais si vous attaquez des
fichiers de plusieurs Mo, il faudra envisager d'ecrire une proc de lecture
en mode binary avec dimensionnement d'un buffer, etc ... En effet, sur un
fichier de plusieurs Mo, lors du 'line input' la variable de destination
remplira avec l'ensemble du fichier puisque la rupture de remplissage se
fait à partir de '0D' (CR - Carriage Return) !
Cdlt,
Salut! :O)
Désolé de ne pas t'avoir répondu avant. :O/
Le problème actuel est l'algorithme. Le résultat que tu obtiens est normal
car c'est ce que ton code ordonne de faire. Un bon truc pour règler ce
de problème, est de regardé ce qu'on as comme donnée au départ, ensuite ce
qu'on veut comme donnée à la fin et ensuite de rédiger un algorithme du
traitement nécessaire à l'obtention du résultat escompté.
--
Cordialement
Yanick Lefebvre - MVP pour Visual Basic
http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
Merci de poster les réponses au groupe afin d'en faire profiter à tous
"Nolofinwe Melwazul" wrote in message
news:
> voila le fichier "domains"
>
> dont je veut prendre chaque ligne pour en faire un fichier xml comme
joint.
> mon code tout simple :
>
> Private Sub Form_Load()
>
> Dim ligne_R As String
> Dim ligne_W As String
>
> Dim var1 As String
>
> 'ModuleF.verifyFile ("/warez/domains")
> var1 = """"
>
> Open "domains" For Input As #1
>
> Open "domain2add.xml" For Output As #2
>
> If Err Then
> MsgBox "Impossible de creer le fichier !"
> Else
> 'header du fichier
> Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
> ".-->"
>
>
> Do While Not EOF(1)
>
> Line Input #1, ligne_R
> Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName=" &
&
> "*" & ligne_R & var1 & " Path=" & var1 & "/" & var1 & ">"
>
> Loop
>
> 'footer du fichier
> Print #2, "</ads>"
>
> Close #2 'Fermeture du fichier.
> End If
>
>
>
> "Zoury" a écrit dans le message de news:
>
> > Salut! :O)
> >
> > Peut-on voir le code!?
> >
> > --
> > Cordialement
> > Yanick Lefebvre - MVP pour Visual Basic
> > http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
> > http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
> >
> >
>
>
>
Salut! :O)
Désolé de ne pas t'avoir répondu avant. :O/
Le problème actuel est l'algorithme. Le résultat que tu obtiens est normal
car c'est ce que ton code ordonne de faire. Un bon truc pour règler ce
de problème, est de regardé ce qu'on as comme donnée au départ, ensuite ce
qu'on veut comme donnée à la fin et ensuite de rédiger un algorithme du
traitement nécessaire à l'obtention du résultat escompté.
--
Cordialement
Yanick Lefebvre - MVP pour Visual Basic
http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
Merci de poster les réponses au groupe afin d'en faire profiter à tous
"Nolofinwe Melwazul" <webmaster@titanesk.com> wrote in message
news:uoON3begDHA.1648@TK2MSFTNGP10.phx.gbl...
> voila le fichier "domains"
>
> dont je veut prendre chaque ligne pour en faire un fichier xml comme
joint.
> mon code tout simple :
>
> Private Sub Form_Load()
>
> Dim ligne_R As String
> Dim ligne_W As String
>
> Dim var1 As String
>
> 'ModuleF.verifyFile ("/warez/domains")
> var1 = """"
>
> Open "domains" For Input As #1
>
> Open "domain2add.xml" For Output As #2
>
> If Err Then
> MsgBox "Impossible de creer le fichier !"
> Else
> 'header du fichier
> Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
> ".-->"
>
>
> Do While Not EOF(1)
>
> Line Input #1, ligne_R
> Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName=" &
&
> "*" & ligne_R & var1 & " Path=" & var1 & "/" & var1 & ">"
>
> Loop
>
> 'footer du fichier
> Print #2, "</ads>"
>
> Close #2 'Fermeture du fichier.
> End If
>
>
>
> "Zoury" <yanick_lefebvre@hotmail.com> a écrit dans le message de news:
> OPWMtSYgDHA.632@TK2MSFTNGP10.phx.gbl...
> > Salut! :O)
> >
> > Peut-on voir le code!?
> >
> > --
> > Cordialement
> > Yanick Lefebvre - MVP pour Visual Basic
> > http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
> > http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
> >
> >
>
>
>
Salut! :O)
Désolé de ne pas t'avoir répondu avant. :O/
Le problème actuel est l'algorithme. Le résultat que tu obtiens est normal
car c'est ce que ton code ordonne de faire. Un bon truc pour règler ce
de problème, est de regardé ce qu'on as comme donnée au départ, ensuite ce
qu'on veut comme donnée à la fin et ensuite de rédiger un algorithme du
traitement nécessaire à l'obtention du résultat escompté.
--
Cordialement
Yanick Lefebvre - MVP pour Visual Basic
http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
Merci de poster les réponses au groupe afin d'en faire profiter à tous
"Nolofinwe Melwazul" wrote in message
news:
> voila le fichier "domains"
>
> dont je veut prendre chaque ligne pour en faire un fichier xml comme
joint.
> mon code tout simple :
>
> Private Sub Form_Load()
>
> Dim ligne_R As String
> Dim ligne_W As String
>
> Dim var1 As String
>
> 'ModuleF.verifyFile ("/warez/domains")
> var1 = """"
>
> Open "domains" For Input As #1
>
> Open "domain2add.xml" For Output As #2
>
> If Err Then
> MsgBox "Impossible de creer le fichier !"
> Else
> 'header du fichier
> Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
> ".-->"
>
>
> Do While Not EOF(1)
>
> Line Input #1, ligne_R
> Print #2, "<Destination Type=" & var1 & "0" & var1 & " DomainName=" &
&
> "*" & ligne_R & var1 & " Path=" & var1 & "/" & var1 & ">"
>
> Loop
>
> 'footer du fichier
> Print #2, "</ads>"
>
> Close #2 'Fermeture du fichier.
> End If
>
>
>
> "Zoury" a écrit dans le message de news:
>
> > Salut! :O)
> >
> > Peut-on voir le code!?
> >
> > --
> > Cordialement
> > Yanick Lefebvre - MVP pour Visual Basic
> > http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
> > http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
> >
> >
>
>
>
"André Joubert" a écrit dans le message de
news:n0kcb.2935$
> Voici le code :
>
> Option Explicit
>
> Private Sub Form_Load()
>
> Dim ligne_R As String
> Dim ligne_W As String
> Dim var1 As String
> Dim a() As String, i%
>
> 'ModuleF.verifyFile ("/warez/domains")
> var1 = """"
>
> Open "domains.dat" For Input As #1
>
> Open "domain2add.xml" For Output As #2
>
> If Err Then
> MsgBox "Impossible de creer le fichier !"
> Else
> 'header du fichier
> Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
> ".-->"
>
>
> Line Input #1, ligne_R
> a = Split(ligne_R, Chr(10))
>
> For i% = 1 To UBound(a)
>
> Print #2, "<Destination Type=" & var1 & "0" & var1 & "
&
> var1 & "*" & a(i%) & var1 & " Path=" & var1 & "/" & var1 & ">"
>
> Next i%
>
> 'footer du fichier
> Print #2, "</ads>"
>
> Close #2 'Fermeture du fichier.
> End If
> End Sub
>
> André
>
Bonjour,
Ce code fonctionnera sur des petits fichiers ... Mais si vous attaquez des
fichiers de plusieurs Mo, il faudra envisager d'ecrire une proc de lecture
en mode binary avec dimensionnement d'un buffer, etc ... En effet, sur un
fichier de plusieurs Mo, lors du 'line input' la variable de destination
remplira avec l'ensemble du fichier puisque la rupture de remplissage se
fait à partir de '0D' (CR - Carriage Return) !
Cdlt,
"André Joubert" <jaji92@sympatico.ca> a écrit dans le message de
news:n0kcb.2935$PT3.442372@news20.bellglobal.com...
> Voici le code :
>
> Option Explicit
>
> Private Sub Form_Load()
>
> Dim ligne_R As String
> Dim ligne_W As String
> Dim var1 As String
> Dim a() As String, i%
>
> 'ModuleF.verifyFile ("/warez/domains")
> var1 = """"
>
> Open "domains.dat" For Input As #1
>
> Open "domain2add.xml" For Output As #2
>
> If Err Then
> MsgBox "Impossible de creer le fichier !"
> Else
> 'header du fichier
> Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
> ".-->"
>
>
> Line Input #1, ligne_R
> a = Split(ligne_R, Chr(10))
>
> For i% = 1 To UBound(a)
>
> Print #2, "<Destination Type=" & var1 & "0" & var1 & "
&
> var1 & "*" & a(i%) & var1 & " Path=" & var1 & "/" & var1 & ">"
>
> Next i%
>
> 'footer du fichier
> Print #2, "</ads>"
>
> Close #2 'Fermeture du fichier.
> End If
> End Sub
>
> André
>
Bonjour,
Ce code fonctionnera sur des petits fichiers ... Mais si vous attaquez des
fichiers de plusieurs Mo, il faudra envisager d'ecrire une proc de lecture
en mode binary avec dimensionnement d'un buffer, etc ... En effet, sur un
fichier de plusieurs Mo, lors du 'line input' la variable de destination
remplira avec l'ensemble du fichier puisque la rupture de remplissage se
fait à partir de '0D' (CR - Carriage Return) !
Cdlt,
"André Joubert" a écrit dans le message de
news:n0kcb.2935$
> Voici le code :
>
> Option Explicit
>
> Private Sub Form_Load()
>
> Dim ligne_R As String
> Dim ligne_W As String
> Dim var1 As String
> Dim a() As String, i%
>
> 'ModuleF.verifyFile ("/warez/domains")
> var1 = """"
>
> Open "domains.dat" For Input As #1
>
> Open "domain2add.xml" For Output As #2
>
> If Err Then
> MsgBox "Impossible de creer le fichier !"
> Else
> 'header du fichier
> Print #2, "<ads>" & "<!--Fichier cree le " & Date$ & " a " & Time$ &
> ".-->"
>
>
> Line Input #1, ligne_R
> a = Split(ligne_R, Chr(10))
>
> For i% = 1 To UBound(a)
>
> Print #2, "<Destination Type=" & var1 & "0" & var1 & "
&
> var1 & "*" & a(i%) & var1 & " Path=" & var1 & "/" & var1 & ">"
>
> Next i%
>
> 'footer du fichier
> Print #2, "</ads>"
>
> Close #2 'Fermeture du fichier.
> End If
> End Sub
>
> André
>
Bonjour,
Ce code fonctionnera sur des petits fichiers ... Mais si vous attaquez des
fichiers de plusieurs Mo, il faudra envisager d'ecrire une proc de lecture
en mode binary avec dimensionnement d'un buffer, etc ... En effet, sur un
fichier de plusieurs Mo, lors du 'line input' la variable de destination
remplira avec l'ensemble du fichier puisque la rupture de remplissage se
fait à partir de '0D' (CR - Carriage Return) !
Cdlt,