editing text file wich consists of many logic sections

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
frosty3d
Forum Newbie
Posts: 4
Joined: Wed May 16, 2007 8:44 am

editing text file wich consists of many logic sections

Post by frosty3d »

Hello!

Could somebody help me?

I have text like this:


light sky
translate 300 800
colour 0.626 0.626 1
intensity 0.5
type directional
pivot -1190 2000 -1608
rotate -44.9937 -143.497 0
size 1000 1000
zrange 10 500000
keyable cx cy cz tx ty tz rx ry rz
shader prman
auto_render 1
shader air
auto_render 1
shader 3delight
auto_render 1
shader velocity
auto_render 1
shader mray
auto_render 1
constrain lookat
End lighting

Render Options

Render
name key_air
images keylight.shd
rib file ./Rib/key_air#.rib
render pass name shadowpass
camera/light key
image type z
renderer 1
resolution option 7
x resolution 512
y resolution 512
pixel samples x 1
pixel samples y 1
auto_render
auto_light key

Render
name key_3delight
images keylight.shd
rib file ./Rib/key_3delight#.rib
render pass name shadowpass
camera/light key
image type z
renderer 1
resolution option 7
x resolution 512
y resolution 512
pixel samples x 1
pixel samples y 1
auto_render
auto_light key

Render
name key_mray
images keylight.zt
rib file ./Mi/key_mray#.mi
render pass name shadowpass
camera/light key
image type z
renderer 1
resolution option 7
x resolution 512
y resolution 512
pixel samples x 1
pixel samples y 1
auto_render
auto_light key

Render *
name render
images changePIC
rib file changeRIB
render pass name beauty
camera/light camera1
image type rgba
renderer 1
resolution option 0
x resolution 720
y resolution 576
pixel samples x 7
pixel samples y 7
shadows 0
mblur 0
mblur shutter 0
mblur samples 0
mblur threshold 1
mblur terrain 0
terrain 1
terrain shadow 1
terrain holdout 0
shading rate 1
shadow bias 10
shutter open 0
shutter close 0.5
terrain displacement bounds 0
end Render Options


I should edit text using regexp in section "Render Options" by subsections named "Render"
For example I need name "render" from last render subsection and name "key_air" from first subsection.
How I can search by sections using regexp? Or how I can get section "Render Options" from text
and separate subsections?

Thank you!

Alex
Last edited by frosty3d on Wed May 23, 2007 9:49 am, edited 2 times in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Descriptive subjects

Post by feyd »

Please update the threads subject to be more descriptive.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
Post Reply