2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -0,0 +1,24 @@
|
|||
' Read a file line by line
|
||||
Sub Main()
|
||||
Dim fInput As String, fOutput As String 'File names
|
||||
Dim sInput As String, sOutput As String 'Lines
|
||||
Dim nRecord As Long
|
||||
fInput = "input.txt"
|
||||
fOutput = "output.txt"
|
||||
On Error GoTo InputError
|
||||
Open fInput For Input As #1
|
||||
On Error GoTo 0 'reset error handling
|
||||
Open fOutput For Output As #2
|
||||
nRecord = 0
|
||||
While Not EOF(1)
|
||||
Line Input #1, sInput
|
||||
sOutput = Process(sInput) 'do something
|
||||
nRecord = nRecord + 1
|
||||
Print #2, sOutput
|
||||
Wend
|
||||
Close #1
|
||||
Close #2
|
||||
Exit Sub
|
||||
InputError:
|
||||
MsgBox "File: " & fInput & " not found"
|
||||
End Sub 'Main
|
||||
Loading…
Add table
Add a link
Reference in a new issue