PDA

View Full Version : Parsing Scenefile question!! Simple one...i think.



CB_3D
10-20-2005, 07:43 AM
Hello friends.


I posted this also in the Lscript forum, but since it seems so undervisited lately...

I want to do the following, but I am not sure if itīs possible.

I want to replace a whole line in one scenefile with one taken from another scenefile.

For example, I need to replace line 27 from SceneA.lws with line 34 from SceneB.lws.

What would the code look like for something like that?

Thx a lot in advance

MonroePoteet
10-20-2005, 10:18 AM
I'd use a text editor.

If you want to do this in bulk (like a bunch of scene files), I wouldn't rely on "Line 27" or "Line 34" having the same content across all scene files. I think you'd want to implement some more sophisticated parsing, like reading in each line, checking for the content you want to replace, and only doing the replacement when you find the correct line.

I'd recommend being VERY CAREFUL about bulk modification of scene files. Sounds like a good way to create a bunch of unusable / corrupted scene files.

mTp