Modifier fichier texte

cs_Sylvain93 Messages postés 42 Date d'inscription jeudi 30 mai 2002 Statut Membre Dernière intervention 27 avril 2011 - 30 mai 2002 à 16:29
GtommarC Messages postés 37 Date d'inscription lundi 20 mai 2002 Statut Membre Dernière intervention 25 avril 2003 - 31 mai 2002 à 18:05
Bonjour,
J'ai un fichier texte de type:
COMPUWORLD BLN5705,
0202001787,29/04/2002
0202001782,29/04/2002
0202001783,29/04/2002
48123343-J7S,29/04/2002

et je voudrais obtenir:
COMPUWORLD BLN5705,0202001787,29/04/2002
COMPUWORLD BLN5705,0202001782,29/04/2002
COMPUWORLD BLN5705,0202001783,29/04/2002
COMPUWORLD BLN5705,48123343-J7S,29/04/2002

Est-ce possible?Si oui, puis je avoir les codes? merci

3 réponses

GtommarC Messages postés 37 Date d'inscription lundi 20 mai 2002 Statut Membre Dernière intervention 25 avril 2003
30 mai 2002 à 22:05
Private Sub Command1_Click()
Dim maconstante As String
Dim mavariable As String
Dim fi As Integer
Dim intfiecriture As Integer

intfi = FreeFile
nomfichier = "c:\temp\essai.txt"
Open (nomfichier) For Input As intfi

intfiecriture = FreeFile
nomfichier = "c:\temp\essai1.txt"
Open (nomfichier) For Append As intfiecriture

Line Input #intfi, maconstante

Do While Not EOF(intfi)
Line Input #intfi, mavariable
Print #intfiecriture, maconstante & mavariable

Loop
Close
End Sub

j'ai fait l'essai
GtommarC
0
cs_Sylvain93 Messages postés 42 Date d'inscription jeudi 30 mai 2002 Statut Membre Dernière intervention 27 avril 2011
31 mai 2002 à 09:26
Merci ca marche!
Mais peux ton rajouté une virgule entre COMPUWORLD ET BLN5705.
Merci
0
GtommarC Messages postés 37 Date d'inscription lundi 20 mai 2002 Statut Membre Dernière intervention 25 avril 2003
31 mai 2002 à 18:05
0
Rejoignez-nous