janerussel
MIS
I have a little vb program that looks for an "*" symbol in a .dat file and replaces it with a "-". It is envolked with a click event.
I need to revise this code to look for a text string "CH.NUM" in the file, on the next line there will be a series of numbers with a "*" in the string. I need to replace the "*" with a "-".
I also need to look for this file on one mapped drive, make the change, cut the file and copy it to another drive.
This application needs to run every five minutes in the background.
I have my original code below, if anyone could help me with this I'd really appreciate it.
Private Sub CmdData_Click()
Open "a:\test.dat" For Input As #1
Open "a:\testout.dat" For Output As #2
Dim intResponse As Integer
Do Until EOF(1)
Line Input #1, strInput
newstring = Replace(strInput, "*", "-"
Print #2, newstring
Loop
Close #1
Close #2
intResponse = MsgBox("The text has been updated, Exit?", _
vbYesNo + vbQuestion, "Exit Application"
If intResponse = vbYes Then
Unload frmWrite
End If
I need to revise this code to look for a text string "CH.NUM" in the file, on the next line there will be a series of numbers with a "*" in the string. I need to replace the "*" with a "-".
I also need to look for this file on one mapped drive, make the change, cut the file and copy it to another drive.
This application needs to run every five minutes in the background.
I have my original code below, if anyone could help me with this I'd really appreciate it.
Private Sub CmdData_Click()
Open "a:\test.dat" For Input As #1
Open "a:\testout.dat" For Output As #2
Dim intResponse As Integer
Do Until EOF(1)
Line Input #1, strInput
newstring = Replace(strInput, "*", "-"
Print #2, newstring
Loop
Close #1
Close #2
intResponse = MsgBox("The text has been updated, Exit?", _
vbYesNo + vbQuestion, "Exit Application"
If intResponse = vbYes Then
Unload frmWrite
End If