Reading a text file containing video filenames

Hi!

I have the following problem, which needs to be resolved:

I would like to read a file, for example a txtfile, which contains a number (for example, from 0 to 10). This number is changed periodically by an outside program. Then I also have a textfile, which contains full paths to different videos (each line in the txtfile is a path to a different video).
I would like to use vvvv so that it would periodically read the file with the number (0-10), and then read the pathname of the corresponding video (for example, if the number is 0, the first pathname would be read). Then I would playback this video.

I’m new to vvvv, so forgive me if this is a trivial question, but I would be very grateful, if someone could provide me with the solution, or at least some tips.

Thanks in advance.

i think parsing texts in general is not that trivial.

for sure you should have a close look at the RegExpr (String) which is already a complete programm “in-a-node”

if you posted any example text here we could supply more information…

parsing XML e.g. is quite fun …

First of all, thank you kalle for your reply.

I now decided that the file, containing the number, would be of type xml, like for example this (I had to replace the with () ):

(?xml version=“1.0” encoding=“utf-8” ?)

  • (hotspots)
    (sequence)92(/sequence)
    (hotspot id=“1”)0(/hotspot)
    (hotspot id=“2”)0(/hotspot)
    (hotspot id=“3”)0(/hotspot)
    (hotspot id=“4”)0(/hotspot)
    (hotspot id=“5”)0(/hotspot)
    (hotspot id=“6”)0(/hotspot)
    (hotspot id=“7”)0(/hotspot)
    (hotspot id=“8”)0(/hotspot)
    (hotspot id=“9”)0(/hotspot)
    (/hotspots)

I would need to read the numbers between (in this example all the zeros).

The other file containing paths to videos would be a txtfile, for example:
C:\Videos\video1.avi
C:\Videos\video2.avi

Thank you for any kind of help.

ok there is need for some words about XML here.

i justed started a wikipage around this.
community, please help with your common knowledge

Hi,

Kalle of course is right (as usual), pointing towards XML-parsing.

… but there are of course also very basic “trditional” ways to extract this kind of information from textfiles.
(one quick n dirty example in attached file)

It is for sure not the cleanest, most failsafe and professional way … but also working.

Markus

withoutxmlknowledge.v4p (5.0 kB)

ah yeah,

also as usual is right: there many ways to rome…

and we both know vvvv since it had perhaps 20% of the nodes it has now.

my first module ever was a “delay (value)” and i remember @gregsn saying “ah yes, why don’t we have this hardcoded?”

you can do almost everything already with a set of 20-50 nodes.
that’s why i still would love vvvv even it still was beta1.

hey Markus, let’s talk/write perhaps tomorrow…