-
Find & Replace using VB 6.0
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?
Similar Threads
-
By awyeah in forum VB Classic
Replies: 5
Last Post: 04-17-2008, 01:22 PM
-
By Michael Kascher in forum VB Classic
Replies: 3
Last Post: 09-01-2006, 03:15 PM
-
By Jon Ogden in forum .NET
Replies: 84
Last Post: 01-29-2001, 02:12 PM
-
By Jean-Yves in forum Enterprise
Replies: 3
Last Post: 06-01-2000, 12:23 PM
-
By Michael Kascher in forum VB Classic
Replies: 2
Last Post: 05-31-2000, 02:48 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|