Forums > MaxMSP

truncate file path from left, not from right ( sprintf ?)

January 25, 2011 | 7:22 pm

Hi maxers

i want to shorten a file path, ideally, it would leave only the top right 2 folders of the path, so this:
Mycomputer:/Users/myself/Music/My Samples/keep this path/keep this path/
would end up with:
/keep this path/keep this path/
how can I truncate the string like that?

The only thing i found is printf in attached example.
it works, but it would truncate from the right and not by words but letters.



– Pasted Max Patch, click to expand. –
January 25, 2011 | 8:00 pm

regexp. Not an easy one to learn, but not impossible either.


– Pasted Max Patch, click to expand. –
January 27, 2011 | 2:42 am

Thanks a lot!

January 28, 2011 | 11:04 pm

atoi zl slice itoa …

Viewing 4 posts - 1 through 4 (of 4 total)