|
|
"Eric" <[firstname]@theothersideofthenet.com> wrote:
> Although far from new to POV-Ray (programmed first rendering in about 1996),
> I am an infrequent user and thus a novice. Right now I'm returning to it to
> produce some 3D statistical graphs. It would be really convenient for me
> read data in from some sort of two-dimensional data file (a table). Comma
> separated value files (.CSV) are commonly used for this. Is there any
> convenient way to read a CSV file into some sort of data container (an
> array of arrays? or can MATRIX be used other than for transforms?)
Yes, and it's pretty much straight-away what you said, minus the arrays of
arrays. I don't think you can really do arrays of arrays per se where
lengths or types may vary etc, but you can certainly do multi-dimensional
arrays up to 5D. Here's a 1D example:
#fopen StatsFile "Stats.csv" read
#local Ctr = 0;
#local Limit = 150; //assuming you know how long it is
#declare StatsArray = array[Limit];
#while(Ctr < Limit)
#read(StatsFile, StatsArray[Ctr])
#local Ctr = Ctr + 1;
#end //end while
Or something like that.... I didn't test it for mistakes/typos. Hope it
helps.
Charles
Post a reply to this message
|
|