I am wondering if there a simple way to change 1 character of a file. Is there a simple program with command prompt that can be executed. I don't really want to open, load, and resave as it is a 30mb file.
Thanks.
Printable View
I am wondering if there a simple way to change 1 character of a file. Is there a simple program with command prompt that can be executed. I don't really want to open, load, and resave as it is a 30mb file.
Thanks.
As you wish to replace part of a file for something the same size the whole file does not have to be loaded.
If you know the position of this byte/char it's even easier. Any old Hex editor should do or a little bit of code...I'm without IDE so the above might want tweaking :)Code:Dim FF as Integer, BytPos as Long, NewChar as byte
FF = freefile
BytPos = 123456 'or whatever
NewChar = Asc("x") 'or whatever
If Lenb(filename) <> 0 Then
'On error resume next 'comment out for debugging
Open filename for binary as #FF
If LOF(ff) >= BytPos then Put #ff,BytPos,NewChar
Close #ff
'On error goto 0
end if