I want to replace text of Houdini file(.hip) which contains mixture of Binary code and Text. I have python code which replace text file. When i try to replace Text in Houdini file the file gets Corrupt after replacement.
Can anyone tell me How to replace text in Houdini file without corrupting it?
code:
import fileinput,sys
for line in fileinput.input("file_name",inplace=True):
line = line.replace("from","to")
sys.stdout.write(line)
When i try to replace Houdini file(.hip) using this code then file gets corrupt.
Do anyone know how to replace Houdini file without opening it ?