Moderatori: Anthony47, Flash30005
Sub buniQueue()
Dim myF As String, myDir As String, newText As String
'
myDir = "C:\PERCORSO\" '<<< Il path contenente i file csv con \ finale
myF = Dir(myDir & "*.csv")
Close #1: Close #2
Open myDir & "OutCsv.csv" For Output As #1
On Error GoTo gErr
Do
DoEvents
If myF = "" Then Exit Do
Open myDir & myF For Input As #2
Line Input #2, friga
newText = newText & friga & vbCrLf
goOn:
Close #2
myF = Dir
Loop
newText = Left(newText, Len(newText) - 1)
Print #1, newText
Close #1
Exit Sub
gErr:
If Err = 55 Then
Err.Clear: Resume goOn
End If
End Sub
Sub buniQueue()
Dim myF As String, myDir As String, newText As String
'
myDir = "C:\PERCORSO\" '<<< Il path contenente i file csv con \ finale
myF = Dir(myDir & "*.csv")
Close #1: Close #2
Open myDir & "OutCsv.csv" For Output As #1
On Error GoTo gErr
Do
DoEvents
If myF = "" Then Exit Do
Open myDir & myF For Input As #2
Line Input #2, friga
newText = newText & friga & "S" & vbCrLf ' <<<< linea modificata
goOn:
Close #2
myF = Dir
Loop
newText = Left(newText, Len(newText) - 1)
Print #1, newText
Close #1
Exit Sub
gErr:
If Err = 55 Then
Err.Clear: Resume goOn
End If
End Sub
Sub buniQueue()
Dim myF As String, myDir As String, newText As String
'
myDir = "C:\PERCORSO\" '<<< Il path contenente i file csv con \ finale
myF = Dir(myDir & "*.csv")
Close #1: Close #2
FName = Format(Date, "yyyy-mm-dd") & ".Ctr_" & Format(Time, "HHmm") & ".csv" '
Open myDir & FName For Output As #1
On Error GoTo gErr
Torna a Applicazioni Office Windows
Inserire dati filtrati da 2 file ad un terzo file Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 14 |
File batch per copiare file selezionato da menu contestuale Autore: valle1975 |
Forum: Programmazione Risposte: 3 |
Visitano il forum: Nessuno e 20 ospiti