Private Sub Form_Load() Dim L$() File1.Pattern = "*.txt" File1.Path = App.Path Open App.Path & "\resultat.csv" For Output As #2 For i = 0 To File1.ListCount - 1 Open App.Path & "" & File1.List(i) For Input As #1 While Not EOF(1) Line Input #1, coco L$ = Split(coco, ":") Print #2, Trim$(L$(1)) & ";"; Wend Close #1 Print #2, Next i Close #2 End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Declare Function ShellExecuteA Lib "shell32" (ByVal hwnd As Long, ByVal LPFile As String, ByVal PathFile As String, ByVal Other As String, ByVal Other2 As String, ByVal Param As Long) As Long
RetVal = ShellExecuteA(0, "Open", App.Path & "\exportationEXCEL.csv", "", "", 10)
RetVal = ShellExecuteA(0, "Open", App.Path & "\resultat.csv", "", "", 10)
Private Declare Function ShellExecuteA Lib "shell32" (ByVal hwnd As Long, ByVal LPFile As String, ByVal PathFile As String, ByVal Other As String, ByVal Other2 As String, ByVal Param As Long) As Long Private Sub Form_Load() Dim L$() File1.Pattern = "*.txt" File1.Path = App.Path For i = 0 To File1.ListCount - 1 Text1 = "" Open App.Path & "" & File1.List(i) For Input As #1 While Not EOF(1) Line Input #1, coco If InStr(1, coco, ":") Then Text1 = Text1 & vbCrLf Text1 = Text1 & Trim$(coco) & " " Wend Close #1 chemin = App.Path & "\New_" & File1.List(i) Open chemin For Output As #2 Print #2, Text1 Close #2 Kill App.Path & "" & File1.List(i) Next i Open App.Path & "\resultat.csv" For Output As #2 For i = 0 To File1.ListCount - 1 Open App.Path & "\New_" & File1.List(i) For Input As #1 While Not EOF(1) Line Input #1, coco If coco = "" Then GoTo 100 L$ = Split(coco, ":") Print #2, Trim$(L$(1)) & ";"; 100 Wend Close #1 Print #2, Next i Close #2 RetVal = ShellExecuteA(0, "Open", App.Path & "\resultat.csv", "", "", 10) End Sub