how to deal space in folder and file name in max external [shell], [regexp] or [sprintf]?

Oct 24, 2009 at 1:24am

how to deal space in folder and file name in max external [shell], [regexp] or [sprintf]?

Dear users,

my problem is how to correctly send following messages to the [shell]?

interactive additive synth/sonic prism.scd
interactive additive synth/sonic_prism.scd
interactive_additive_synth/sonic prism.scd

In [shell] does not work a space.
I must send a message with [sprintf], but the a space in truncate a complete path and file name.

I have also tried [regexp] with substitue. However, if a strng has no space, [regexp] does not produce the original string but nothing!

The problem is, there can be a space and also can be no space!

I tried alone some days.
I have not found a solution.

best,
prko

#46044
Oct 24, 2009 at 7:25am

Does it help to put it between quotes?

– Pasted Max Patch, click to expand. –

In this regard, the tosymbol object is useful.

#165874
Oct 24, 2009 at 4:25pm

Alternately, he could add a backslash before the spaces, although enclosing the thing in double quotes would be easier in a situation where he always dealt with the same kind of data….

#165875
Oct 24, 2009 at 10:44pm

The two methods, I had tried.
Can you give a patch instead of a recommendation?

My actual patch is as follows:

– Pasted Max Patch, click to expand. –
#165876
Oct 25, 2009 at 1:32pm

this is how to format spaces with spritf (culled straight from the helpfile)

– Pasted Max Patch, click to expand. –
#165877
Oct 25, 2009 at 1:51pm

thanks, I solved the problem.

#165878

You must be logged in to reply to this topic.