|
一例です。
Sub test()
Dim oFold As String
Dim backup As String
Dim fileToOpen
Dim tmpfile As String
Dim myLine As String
oFold = Sheet1.Range("A1").Value
backup = CurDir
ChDir oFold
fileToOpen = Application.GetOpenFilename("Text Files (*.prn), *.prn")
If fileToOpen <> False Then
tmpfile = oFold & "\tempfile"
Name fileToOpen As tmpfile
Open tmpfile For Input As #1
Open fileToOpen For Output As #2
Do While Not EOF(1)
Input #1, myLine
Print #2, Replace(myLine, "*", "* 0 0 1")
Loop
Close #2
Close #1
Kill tmpfile
End If
ChDir backup
End Sub
|
|