wildcards in filepaths?

Mar 2, 2013 at 6:41pm

wildcards in filepaths?

hi,
noob question, sorry – but how the heck do i specify a wildcard in a filepath? i tried “*” but that does not do the trick.

background: i want to read .jxf-file sequences from disk which have a name like this: “frame00004_*.jxf” – where the “*” is a number i use to handover metadata. below i attached a short patch to illustrate what i am trying to achieve.
thanks a lot for help!
k

– Pasted Max Patch, click to expand. –
#66820
Mar 3, 2013 at 5:13am

have a look at combine or regexp

#240537
Mar 3, 2013 at 6:35am

well, this is what i do (combine), see patch… so how does it work?
i think the problem is not the creation of the filepath symbol but its interpretation by the read-message of jit.matrix…?
k

#240538
Mar 3, 2013 at 12:15pm

Sorry Karl i didn’t have a MaxMsp to check yesterday

Well just replace * by an int !

combine r1:/ frame 0 _ i .jxf @padding 0 0 5 @triggers 2

#240539
Mar 3, 2013 at 5:06pm

hey tep, thanks for getting back to me!
i tried with “i” but that does only work when i do know which number i replace the integer with… i guess i have to rephrase my problem: “how do i place a wildcard in a read message, sent to a matrix?”
like, how do i tell the matrix to read a file of which i do not know it’s precise name, but only the beginning like eg. “frame0001*”?
k

#240540
Mar 3, 2013 at 8:06pm

We don’t support filename wildcards, so you’ll need to use something like the folder object to grab all the names and pass through the ones that match via regexp or in JS or some other similar strategy. Sorry for the inconvenience, but maybe if you search the forums or online someone has an example that would be useful.

#240541
Mar 4, 2013 at 4:04am

But would there be no solution with regexp ? Matching as many characters between frameXXXX***** until .jxf ?

#240542
Mar 4, 2013 at 7:45pm

ah!
thanks a lot for the clarification! i thought this would be something really simple and i just don’t get it…
searching the whole folder is not really feasible in my case, it’s a large image sequence and there are 90.000 files. i guess i just have to figure out another way to save my metadata… thanks though!
k

#240543

You must be logged in to reply to this topic.