The string replacement bit isn't a problem as that already works, the trouble is reading the file and writing it back.
At the moment, I'm just trying to read it, and write it back and check the file is exactly the same as originial.
Code is below, but the problems I'm encountering are an end of file error and it seems to be interpretating nulls as VBCrlf.
So for example, if you imagine # is a null, the string aaaa#444#dddd becomes
aaaa
4444
dddd
Not good!
Here's the code extract, SourceFile comes from the window interface.
Expand|Select|Wrap|Line Numbers
- fnum1 = FreeFile
- Open SourceFile For Binary As fnum1
- fnum2 = FreeFile
- Open Left(SourceFile, Len(Trim(SourceFile)) - 4) & "2.NIF" For Append As fnum2
- Do While Not EOF(fnum1)
- Line Input #fnum1, DataLine
- OutputData = OutputData + DataLine
- Loop
- Print #fnum2, OutputData;
- Close fnum1
- Close fnum2