1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| 'déclaration file system object
Dim fso
'déclaration file system object
Dim fso1
'instanciation
Set FSO = CreateObject("Scripting.FileSystemObject")
'instanciation
Set FSO1 = CreateObject("Scripting.FileSystemObject")
'on instance le fichier texte
Set Ftxt = FSO.OpenTextFile("C:\Documents and Settings\un.txt")
'on instance le fichier texte dans lequel on veut ecrire
Set Ftxt1 = FSO1.createTextFile("C:\Documents and Settings\deux.txt",true) 'true=ecrase
'on parcours chaque ligne du fichier texte
Do While Not Ftxt.AtEndOfStream
MaVariable = Ftxt.Readline
'....... <- votre code ici pour traiter chaque ligne
'On ecrit ce que l'on veut dans le fichier
Ftxt1.writeline (left(MaVariable,7))
Loop
Ftxt.Close
'<<<<<<< ECRITURE dans un fichier >>>>>>>>>>>>
Ftxt1.Close |
Partager