Re: [Tutor] find and replace relative to an nearby search string in a file

2009-07-13 Thread A.T.Hofkamp
Pete O'Connell wrote: Write { file /Volumes/raid0/Z353_002_comp_v27.%04d.cin file_type cin name Write1 xpos 13762 ypos -364 } The simplest approach imho is to parse the input with a proper parser, eg PLY or pyparsing. If you want to do the parsing manually, I'd start by classifying eac

[Tutor] find and replace relative to an nearby search string in a file

2009-07-12 Thread Pete O'Connell
Hi, I am trying to do a find and replace in a text file (a nuke script). Here are a couple excerpts from the file that demonstrate what I want to do. I am always looking for the line " name Write1" as my starting point. In the first example below, I want to replace the path, which is 2 lines above