Hi
I am not a vb programmer but I am attempting to code something that will read in a spool file, change a couple of words and then write it out again. It works fine when I'm not changing the length of the file but if I need to change the length of the file I'm running into problems because I'm reading it in as a chunk of data. Obviously specifying the length will not work. Is there any other way I can read this file in? See snippet of code below. Any help much appreciated.
Open Filename For Random Access Read Write As #1 Len = 30000
noDuplex = True
recordNumber = 1
Get #1, recordNumber, inputRecord
dupPosition = InStr(1, inputRecord, dupNone)
If dupPosition <> 0 Then
noDuplex = False
dupPosition = dupPosition + Len(dupNone) + 1
outputRecord = Left(inputRecord, dupPosition - 1) _
& dupSome _
& Mid(inputRecord, dupPosition + 1)
Put #1, recordNumber, outputRecord1
End If
Close #1