ConcatFiles




Private Function Fileconcat(ByVal SourceFile1 As String, _
ByVal SourceFile2 As String, _
ByVal DestinationFile As String) As Long
Dim strMine As String
Dim lngPCLength As Long
Dim lngLoop As Long
Dim lngUnixPOS As Long
Dim strChar As String * 1
Dim objFSO As Scripting.FileSystemObject
Dim objSourceAs Scripting.TextStream
Dim objDestination As Scripting.TextStream
Set objFSO = New Scripting.FileSystemObject
objFSO.CopyFile SourceFile1, DestinationFile, True

Set objSource = objFSO.OpenTextFile(SourceFile2, ForReading, _
False, TristateFalse)
Set objDestination = objFSO.OpenTextFile(DestinationFile, _
ForAppending, False, TristateFalse)

Do While Not objSource.AtEndOfStream
strChar = objSource.Read(1)
objDestination.Write strChar
Loop

objSource.Close
objDestination.Close
Set objSource = Nothing
Set objDestination = Nothing
Set objFSO = Nothing
End Function
' Inputs:

Due files sorgenti ed un file di destinazione

' Returns:

La combinazione dei due files byte per byte
The combination of the two files, byte for byte.

'Assumes:

Richiede i references di MicroSoft Scripting Runtime Object
File System Object o SCRRUN.dll











( concatfiles.html )- by Paolo Puglisi - Modifica del 17/12/2023