delete multi-line block of text with internal flag in povray file
- by Sibo Lin
I have a pov-ray file, which defines a lot of cylinders and spheres. Sometimes these shapes are defined to have "color@", which makes the povray unrenderable. One solution I've found is to delete the offending cylinders and spheres. So a file that contains this text
cylinder {
< -0.17623, 0.24511, -0.27947>, < -0.15220, 0.22658, -0.26472>, 0.00716
texture { colorO }
}
sphere {
< -0.00950, 0.00357, 0.00227>, 0.00716
texture { color@ }
}
cylinder {
< -0.00950, 0.00357, 0.00227>, < 0.00327, 0.00169, 0.00108>, 0.00716
texture { color@ }
}
sphere {
< 0.15373, 0.00601, 0.18223>, 0.00716
texture { colorO }
}
would turn into this text
cylinder {
< -0.17623, 0.24511, -0.27947>, < -0.15220, 0.22658, -0.26472>, 0.00716
texture { colorO }
}
sphere {
< 0.15373, 0.00601, 0.18223>, 0.00716
texture { colorO }
}
Is there some way to do this replacement with a shell script? Preferably in tcsh. Thanks!