I have a program I am working on to make modifying my game CFG files for one of my racing games. What I am trying to do is search the opened CFG file for a certain 'block' of text, and replace it with another 'block' of text, without disturbing the rest of the file's structure. I am still relatively new to .NET, so bear with me if I don't word things clearly!
This is a section of the CFG file (The bold area is the 'block' I need to find and replace):
Is there any way to find that highlighted section, and replace it with a similar section?Code:# Vehicle importer wizard generated vehicle configuration file # center -0.005 0.670 0.019 material 0x00000000 0x0005000B 0x0005000B compound compound chassis body 0.0 0.0 0.0 0.0 0.0 0.0 0.001 box 0.001 0.001 0.001 noclick bone body 0.001 -0.227 -1.833 0.000 0.000 0.000 10.000 cars\racers\Axis_V3\meshes\_phys_chassis_F.scx ;0x0000000C # FL wheel # type 10.000 sphere 0.44 spring 0.290 0.100 0.050 wheel -0.785 -0.544 -1.305 0.000 0.000 0.000 1.000 1.000 1.000 0.000 wheelbones slot 0.000 0.000 0.000 0.000 0.000 0.000 101 ; FL wheel attach 0x00040100 1 ; 14 attach 0x00040101 1 ; 15 attach 0x00040102 1 ; 16 attach 0x00040103 1 ; 17 attach 0x00040104 1 ; 18 attach 0x00040105 1 ; 19 attach 0x00040106 1 ; 20 attach 0x00040107 1 ; 21 slottype 101 slotdmgmode 0x00000005 slot 0.000 0.000 0.000 0.000 0.000 0.000 201 ; FL suspension arm slottype 301 slotdmgmode 0x00000006




Reply With Quote