I am developing a program in VB 6 to replace a value in a text file. I have 2 text files. I need to open the 1st text file(X1.txt), get the date from this file. Then open the 2nd text file(X2.txt) and replace the date in the 2nd file with the date I got from the 1st text file.
I have the code for the 1st section

Open strSource & "X1.TXT" For Input As #X
Do While Not EOF(X)
Line Input #X, strLine
If strLine Like "*##/##/####*" Then
For R = 1 To Len(strLine)
If Mid$(strLine, R, 10) Like "*##/##/####*" Then date from the source file.
strLine = Mid$(strLine, R, 10)
strSourceDate = Trim(strLine): Exit Do
End If
Next
End If
Loop

The string “strSourceDate” has the date from the 1st text file. I want to replace the date in the 2nd file, with this date. The 2 files have the same format and data.
How do I do this?