|
|
"Nicolas Alvarez" <nic### [at] gmailisthebestcom> wrote in message
news:47bcab82$1@news.povray.org...
>> Hmm.. I'm wondering if pov can read each line as text, append the comma,
>> and
>> write it to an intermediate file..
>>
>> Read bang1.csv, append comma, write to data.csv, then read the values in
>> from
>> data.csv.. Something like that.
>>
>
> Nope, POV-Ray can't read line-by-line...
Hi Dave,
Nicolas is right that the POV-Ray parser can't do this, but the Windows
POV-Ray editor can, and most professional text editors can too.
If you've got a decent text editor (for example Ultraedit) that recognises
line end/carriage return characters, you can do a global change, changing
all carriage returns to a comma followed by a carriage return. Don't forget
to delete the last one at the end of the last line or you'll be adding an
unwanted field.
Alternatively you can use a columnar editor (e.g. Ultraedit or the Windows
POV-Ray editor) to add a comma to the front of each line. Because the
POV-Ray #read directive ignores line end characters it's not going to care
if the comma is at the end of one line or the start of the next.
To do this in the Windows POV-Ray editor you can click at the beginning of
the second line (not the first line or you'll add a superfluous field to the
start of the first line). Then scroll down to the bottom of the file by
clicking and dragging the vertical scroll bar (don't tab down or page down
or anything else that moves the caret). Use Ctl-Shift-Click to the start of
the last line. You should get a thick black line at the start of all lines
from line 2 to the bottom of the file. Anything you now type should get
added to the start of each selected line, so type a single comma then click
anywhere else to come out of columnar edit mode.
Hey presto! You should be able to change a file in this way in about 10
seconds (with a little practice) no matter how big it is. If you have
hundreds of files to change you'll probably need an editor that can do
multi-file global changes (like Ultraedit).
Regards,
Chris B.
Post a reply to this message
|
|