POV-Ray : Newsgroups : povray.off-topic : Use case : Re: Use case Server Time
29 Jul 2024 14:11:40 EDT (-0400)
  Re: Use case  
From: Francois Labreque
Date: 26 Aug 2011 09:48:41
Message: <4e57a439$1@news.povray.org>

>>> As best as I can tell, it's a line-based file format, where each line
>>> contains a key/value pair. Basically if I use the tool and it changes
>>> the line that says "mode=7" to read "mode=9", then I want to make that
>>> change to all the files in the set. Similarly if it adds a new line or
>>> removes an existing one.
>>>
>>> I imagine you can probably do it somehow using diff and patch. But
>>> those aren't usually present on Windows. (I gather Emacs has a special
>>> mode for viewing the output from diff or something like that...
>>> Presumably that only works on Unix though.)
>>
>> Install perl. I don't remember perl at all, but it's probably a simple
>> one-liner. A few switches on the command line and a simple regex
>> substitution should do the trick. The right tool for the job, plain and
>> simple. And yes, it's available for windows in a standard windows
>> install package.
>
> The right tool for the job would obviously be some sort of file
> comparison tool - which Perl isn't.

Do you need to make the same change in each file?  If so, Perl or sed, 
or awk are perfect tools for the job.

I don't see where diff comes into play...

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.