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
| Sub Test()
Dim Cha1 As Long, Cha2 As Long
Dim Source As String, Target As String
Dim s As String
Dim t
Source = "c:\data\temp\test-csv\test.csv"
Target = "c:\data\temp\test-csv\test" & Format(Now(), "yyyymmddhhnnss") & ".csv"
Cha1 = FreeFile
Open Source For Input As Cha1
Cha2 = FreeFile
Open Target For Output As Cha2
Do While Not EOF(Cha1)
Line Input #Cha1, s
t = Split(s, ";")
s = """" & Join(t, """;""") & """"
Print #Cha2, s
Loop
Close #1
Close #2
Kill Source
Name Target As Source
End Sub |
Partager