Conversion fichier unix en fichier dos

thguillon Messages postés 33 Date d'inscription lundi 16 juin 2003 Statut Membre Dernière intervention 20 juin 2006 - 16 juin 2003 à 17:00
CDAlstom Messages postés 69 Date d'inscription mercredi 21 septembre 2005 Statut Membre Dernière intervention 6 mars 2006 - 22 nov. 2005 à 10:29
Est-ce que quelqu'un pourrait me filer une de ses sources pour convertir un fichier texte UNIX en un fichier texte au format DOS?
En fait, mon problème c'est que à la fin d'une ligne sous unix, il n'y a que le line feed alors qu'au format DOS, il y a line feed et carriage return.

Merci d'avance

2 réponses

Delbeke Messages postés 200 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 18 novembre 2005
16 juin 2003 à 19:39
Private Sub Command1_Click()
Dim hFich As Integer
Dim strTemp As String
Dim lLongFich As Long

hFich = FreeFile
Open "Fichier.Txt" For Binary As #hFich
lLongFich = LOF(hFich)
strTemp = String(lLongFich, Chr(0))
Get #hFich, 1, strTemp
strTemp = Replace(strTemp, vbLf, vbCrLf)
Put #hFich, 1, strTemp
Close #hFich

End Sub

Jean-Luc
0
CDAlstom Messages postés 69 Date d'inscription mercredi 21 septembre 2005 Statut Membre Dernière intervention 6 mars 2006
22 nov. 2005 à 10:29
thguillon ne t'as pas répondu et surtt remercie, moi plus de 2 ans après, je le fait! C'est simple et ça marche!
0
Rejoignez-nous