New and confused :-)

Hello everybody,

i am pretty new in the fields of v4, and maybe that is why i am getting a little confused about it. but i hope you can advise me some good tutorials or examples for my problem. (all introductive videos are watched :-) )
My problem is as simple as it sounds, if i would knew how to solve it.
My input is a file, cvs (semicolon separated) with

stepId;x;y;value1;value2;…

now i want to have a loop where i get just the data for stepId=1 then 2, 3, and so on. and with this data i want to draw the x,y coords with some other properties.
So how can i create that. Plz advise me a good howto or give me some tips and hints as response.

thx
Valentin

PS: i forgotten that there are around 20000 lines with stepId 1, and 17000 for stepId = 2 and so on. so it is allways some kind of state definition for all objects at a defined stepId

and of course it is a csv file. (too late)

for a start you could look at the help patches of Reader (File) and Separate (String). then you will need an AsValue (String) does this help?

Hi Val,

Firstly, I guess you know that you use the Reader(File) node to read the files that you’re after. Secondly, assuming the that CVS file is doing what it ought to you should actually be able to read it!

What I usually do now is use the “Separate(String)” node (or the tokenizer) to split the CSV string into lots of separate string slices.

The next thing I do requires a bit of maths but bare with me -

You can now GetSlices(string) that you need from the spread created, and as you want the get the x and y slices from your data. These will be index 1 and 2. The next part depends on how many other values are included before the next stepid. If it were just as you described, with id-x-y-val1-val2 you know that you have to look for the x and y slices every 4 slices there after.

Use “I(spreads)” to set the index numbers in line FROM the first ID value, which was 0 to whatever the last StepID number is.
Then make a “(Value)" node to multiply those index numbers by 4 because you want to land on the 4th slice of the spread each time.
Finally make a “+(Value)” node to add the incoming values from "
” and add “1” to get the x value and another slice with “2.” to return y value. Connect it to the Getslice index pin.

After that you just need the "AsValue(String) node to turn the strings into something you can work with. and maybe a combination of Shift(Spreads), LFO(animation) and Getslice(Spreads) to move through your data.

All the above said though, is there anyway you can trim down the amount of data you’ve got in th CSV, because it sounds like you have a lot of unnecessary data in there if all that you need are the x/y coordinates. English is my first language but even I may find my explanation complicated; I don’t mind if you ask for clarification.

Had

Hello,

first of all thanks for your replys. But how can i sort the data. because it is that first 20000lines are stepID=1, next 17000 are for stepId=2 and so on. it is constantly getting a lower count of lines. and i do NOT know the exact line count for each and every stepid, but i have no idea how tocreate a condition that works. i know how to make a condition (basics) but how can i tell the program show first 10sek stepid 1 lines then stepId 2 lines and so on.
thanks for all,
Valentin

ps:i have simply no real idea how to translate something like

readfile(X) -> getDataFor(stepId) -> showData() where showdata for example shows a sphere for each and every x,y coord set.

all i got is something like

readfile(X) -> foreach line get x,y -> translate sphere (no idea to show two or more without adding another sphere node) but in 2d(have to find howto implement mouse movment first :-) but that shouldn’t be that hard).

and the data string is not defined with a specific length.

thx
Valentin

Can you make a spread that consists only of the stateID fields, one after the other? Because then you could find out how many lines of each stateID you have with CountIndices (Spreads).

And also:

Do you want an actual loop (like one line every frame), or do you want all the coordinates passed at once? Because in VVVV is almost always advisable to think in spreads and not in (for-)loops when dealing with large data-sets.

And still I am not completely sure I understand your problem, so perhaps you could you share the data file? Or a sample of your data?

Jakob

ok let me try to descripe it another way. and which spread can i use for that.

i have

Reader -> separator (newline) -> “miracle occures” -> my result :-)

i have a loot of data. grouped by the stepId and i should provide a patch that loads that data from a file and shows in a loop (step 1…20) the data.

step 1 -> data -> show
step 2 -> data -> show
step 3 -> data -> show
step 1 -> data -> show
step 2 -> data -> show
step 3 -> data -> show

an it should show for example a sphere for each and every entrie for a specific step. and i had no clue how to do something. but with the good help here i am slowly getting into v4 (very slow). my usual profession is c/c++, opencl, and so on, which makes it hard for me to think another way.

cheers,
Valentin

Okay I went ahead and made something:

StepIDstuff.v4p (21.2 kB)

if each step has about 20.000 lines, its not the best way to parse it (about 400.000 lines) with vvvv. in this case you could write a simple plugin which parses the data and puts it out according to a frame number or time value. create a Template (Value) and right click it… from there on it should be easy if you know how to code…

wow. ok to find out what you have created i would probably need another day(wee) or two. ! big, bigger, biggest thx. * 10^10^10

but to be honest - i have, in the moment, no clue why it is doing what it is doing ^^