POV-Ray : Newsgroups : povray.general : selecting several thousand lines in pov file Server Time
4 Aug 2024 06:14:11 EDT (-0400)
  selecting several thousand lines in pov file (Message 6 to 15 of 35)  
<<< Previous 5 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Jim Charter
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 11:37:02
Message: <3f672e1e$1@news.povray.org>
Warp wrote:
> Steve Shelby <ssh### [at] rexnetnet> wrote:
> 
>>That's what I'm doing now. The problem is that it takes 5-10 minutes to
>>scroll down that many lines.
> 
> 
>   If you grab the scrollbar at the right and drag it down, it shouldn't
> take too much. That's what the scrollbar is for.
> 
If the file is very large it is difficlt to do this accurately.  One 
thing I try is to devise a strategy where I select off the topmost block
and either delete it or copy it.  That way I can use the Find to get to 
the middle point, mark it then 'scroll bar' quickly to the top and Shift 
click there to select the block.


Post a reply to this message

From: ABX
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 12:25:29
Message: <jrdemv8brfoighaectslio426naeab03e9@4ax.com>
On Tue, 16 Sep 2003 15:40:25 +0200, ABX <abx### [at] abxartpl> wrote:
> You can do this in general way applying method like in... CSG object.
> Applying intersection can be replaced with applying difference if you
> understand what I mean :-)

In case you didn't here is sequence of keys needed to cut lines from 8605 to
17361 within POV-Ray for Windows editor assuming your file is open and active

Ctrl+G
      8
       6
        0
         5
          Enter
               Shift+Ctrl+Home
                              Del
                                 Ctrl+G
                                       8
                                        7
                                         5
                                          6
                                           Enter
                                                Shift+Ctrl+End
                                                              Del
where 8756 is 17361-8605 :-)

ABX


Post a reply to this message

From: Tim Cook
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 12:54:59
Message: <3f674063$1@news.povray.org>
Wouldn't it be easier to just put the several thousand lines
in a separate .inc file?  Then you only need to move one line
in the .pov file. ;)


Post a reply to this message

From: Jerry
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 13:20:31
Message: <jerry-C52202.10202816092003@netplex.aussie.org>
In article <3f670e1a$1@news.povray.org>,
 "Steve Shelby" <ssh### [at] rexnetnet> wrote:

>Hi,
>Is there an easier way to do this? I have about 9,000 lines, one of several
>mesh2 objects, in a pov file, that I want to select in order to copy and
>paste to another pov file, which also contains several mesh2 objects. The
>only would I know to do this is to start selecting and scroll, and scroll,
>and scroll.......and scroll until an eternity later I finally have the whole
>thing selected. It seems like one ought to be able to tell Povray to "select
>from line 8605 to line 17361" and it would be done, but I can't find any way
>to do that, nor can I find anything in the documentation about it. Am I
>stuck doing it the hard way?
>Steve Shelby

#!/usr/bin/perl

while ($ARGV[0] =~ /^-(start|end)=([0-9]+)/) {
   $cmd = $1;
   $number = $2;
   if ($cmd eq 'start') {
      $startline = $number;
   } else {
      $endline = $number;
   }
   shift;
}

while (<>) {
   $line++;
   print if ($line >= $startline && ($endline<= 0 || $line <= $endline));
}

Save it as "clip" and ensure however you do so for your OS that it is 
executable.

Use as (on Unix)

clip -start=xx -end=xx filename

On Mac OS X, for example, I might use:

clip -start=8605 -end=17361 meshes.pov | pbcopy

And then I could paste those lines into another document.

On Linux, I might use:

clip -start=8605 -end=17361 meshes.pov > wantedmeshes.pov

to put those lines into a file called "wantedmeshes.pov"

I don't know the syntax for using perl on Windows, but it would probably 
be similar.

Leave out -start to start at the beginning, and leave out -end to go to 
the end. You can do multiple files, but it will start counting from the 
first file and continue on counting through subsequent files, which 
probably isn't generally what you want.

Jerry
-- 
"Give a man a fish and you feed him for a day. Teach him to fish, and you've
depleted the lake."--It Isn't Murder If They're Yankees
(http://www.ItIsntMurder.com/)


Post a reply to this message

From: Gilles Tran
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 14:33:47
Message: <3f67578b@news.povray.org>

news:3f670e1a$1@news.povray.org...
> to do that, nor can I find anything in the documentation about it. Am I
> stuck doing it the hard way?

Copy the file into a spreadsheet (e.g. Excel), do the job there and copy the
result back.
Actually I often use Excel for this sort of job.

G.


-- 
**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: Tom Melly
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 14:58:47
Message: <3f675d67@news.povray.org>
"Steve Shelby" <ssh### [at] rexnetnet> wrote in message
news:3f670e1a$1@news.povray.org...
> Hi,
> Is there an easier way to do this? I have about 9,000 lines, one of
several

<snip>

It's been suggested once as a solution by Tim Cook, but it deserves
re-emphasising - right proper include files.

It's then very easy to either add or comment out, or modify a boolean to
change the scene option, and, in your case, which files are included.

This is the portable and native method in pov for doing what you want - why
re-invent the wheel?

Just have stuff like:

#declare do_man = false;
#declare do_woman = true;

#if(do_man)
    #include "man_msh.inc"
    object(man)
#end

#if(do_man)
    #include "woman_msh.inc"
    object(man)
#end


Post a reply to this message

From: Peter Popov
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 17:28:23
Message: <9nvemvcfbtmqsre6c070agg4rmea6m0iah@4ax.com>
On Tue, 16 Sep 2003 08:20:24 -0500, "Steve Shelby"
<ssh### [at] rexnetnet> wrote:

>Hi,
>Is there an easier way to do this?

Yes.

Go to the first line of the mesh file. Place a bookmark (Ctrl-F2). Go
to the opening brace of the mesh and find the matching closing brace
(Ctrl-] I think). Place a bookmark there on the line below the closing
brace. Go to the first bookmark (Shift-F2), then click and hold the
mouse button at the beginning of the line. Now go to the second
bookmark (F2) without releasing the mouse button. Voila.

Just tried it BTW. It works :)


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Marc Champagne
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 18:16:16
Message: <Xns93F8B97A048E3POVMIKA@204.213.191.226>
"Gilles Tran" <git### [at] wanadoofr> wrote in
news:3f67578b@news.povray.org: 


> de news:3f670e1a$1@news.povray.org...
>> to do that, nor can I find anything in the documentation
>> about it. Am I stuck doing it the hard way?
> 
> Copy the file into a spreadsheet (e.g. Excel), do the job
> there and copy the result back.
> Actually I often use Excel for this sort of job.

Oooooouch, so long as it works for you, I guess it's alright.

Excel does have a limit of 65,536 lines though.

I try as much as possible to stay away from word/excel, you
know whats going in but cannot rely on what comes out :) 

There are tons of "programmer" text editors out there up for
grabs, I very good one I have been using for a number of
years is editplus, you can have a look here.

    	http://www.editplus.com/. 

It supports

- PC/Mac/Unix line termination, you can switch on the fly.

- Plain-text, unicode, UTF-8

- It supports keyword highlighting for many languages.
  (you can define your own for POV code too)

For what it's worth, it can come very handy to some of you.

-- 
Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

From: Steve Shelby
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 19:39:11
Message: <3f679f1f$1@news.povray.org>
Peter,
Your answer looked like just the thing I was looking for, but when I tried
it, it went from the first bookmark to the second, as predicted, but without
highlighting. I tried it several times in several different ways, but the
best it would do was highlight the last line. Is it possible you left
something out of your instructions?
Steve

"Peter Popov" <pet### [at] vipbg> wrote in message
news:9nvemvcfbtmqsre6c070agg4rmea6m0iah@4ax.com...
> On Tue, 16 Sep 2003 08:20:24 -0500, "Steve Shelby"
> <ssh### [at] rexnetnet> wrote:
>
> >Hi,
> >Is there an easier way to do this?
>
> Yes.
>
> Go to the first line of the mesh file. Place a bookmark (Ctrl-F2). Go
> to the opening brace of the mesh and find the matching closing brace
> (Ctrl-] I think). Place a bookmark there on the line below the closing
> brace. Go to the first bookmark (Shift-F2), then click and hold the
> mouse button at the beginning of the line. Now go to the second
> bookmark (F2) without releasing the mouse button. Voila.
>
> Just tried it BTW. It works :)
>
>
> Peter Popov ICQ : 15002700
> Personal e-mail : pet### [at] vipbg
> TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Jim Charter
Subject: Re: selecting several thousand lines in pov file
Date: 16 Sep 2003 19:40:10
Message: <3f679f5a$1@news.povray.org>
Peter Popov wrote:
> On Tue, 16 Sep 2003 08:20:24 -0500, "Steve Shelby"
> <ssh### [at] rexnetnet> wrote:
> 
> 
>>Hi,
>>Is there an easier way to do this?
> 
> 
> Yes.
> 
> Go to the first line of the mesh file. Place a bookmark (Ctrl-F2). Go
> to the opening brace of the mesh and find the matching closing brace
> (Ctrl-] I think). Place a bookmark there on the line below the closing
> brace. Go to the first bookmark (Shift-F2), then click and hold the
> mouse button at the beginning of the line. Now go to the second
> bookmark (F2) without releasing the mouse button. Voila.
> 
> Just tried it BTW. It works :)
> 
> 
> Peter Popov ICQ : 15002700
> Personal e-mail : pet### [at] vipbg
> TAG      e-mail : pet### [at] tagpovrayorg

Are you sure?  When I tried it over a large number of lines, only the 
last dozen or so lines remained selected.


Post a reply to this message

<<< Previous 5 Messages Goto Latest 10 Messages Next 10 Messages >>>

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