Re: [Tutor] Find multiple lines in a file

2005-11-09 Thread billburns
[Kent wrote] > > OK, none of my suggestions gets you closer to this...the simplest way is > > if you can read the whole file into memory. Then you can just replace > > the strings in place and write it out again. For example: > > > > oldPolicies = '''<< > > /Policies << > >/PageSize 3 > > >>

Re: [Tutor] Find multiple lines in a file

2005-11-09 Thread Bill Burns
>> I have a PostScript file which contains the following lines (the numbers >> are for reference only and are *not* in the file): >> >> 1 << >> 2 /Policies << >> 3 /PageSize 3 >> 4 >> >> 5 >> setpagedevice >> >> I want to open the the file and read it, find these five lines and then >> re

Re: [Tutor] Find multiple lines in a file

2005-11-09 Thread Kent Johnson
Bill Burns wrote: > I have a PostScript file which contains the following lines (the numbers > are for reference only and are *not* in the file): > > 1 << > 2 /Policies << > 3 /PageSize 3 > 4 >> > 5 >> setpagedevice > > I want to open the the file and read it, find these five lines and t

[Tutor] Find multiple lines in a file

2005-11-08 Thread Bill Burns
I have a PostScript file which contains the following lines (the numbers are for reference only and are *not* in the file): 1 << 2 /Policies << 3 /PageSize 3 4 >> 5 >> setpagedevice These lines never change and are always formatted like this (at least in the PostScript files that I'm gene