My program saves .ji files, and separately saves .trs and .prs files with the same name as the chosen .ji file. Same thing when it loads a .ji file. Right now, I have something like the attached file. It should take the input "filename.ji" and output "filename". 2 problems: a) any numbers in the file path are replaced with the text "float", b) it would be nice for it to know whether ".ji" was already on the end, because if someone types a name for save-as and doesn't put .ji on the end, it lops off the last three characters as though they were ".ji".
I thought makefilename might help, but it only works for putting together, not taking apart. I'm a little rusty on string manipulation in Pd. Is there a simple way to set up something like this?
Thanks.
-Chuckk
I thought makefilename might help, but it only works for putting together, not taking apart. I'm a little rusty on string manipulation in Pd. Is there a simple way to set up something like this?
there's stripfilename from iem. there was also etter one that cut symbols
trough a definable character, but I can't remember which it was.
On Tue, 2006-11-21 at 10:30 +0100, João Miguel Pais wrote:
I thought makefilename might help, but it only works for putting together, not taking apart. I'm a little rusty on string manipulation in Pd. Is there a simple way to set up something like this?
there's stripfilename from iem. there was also etter one that cut symbols
trough a definable character, but I can't remember which it was.
with [symbol2list] from zexy you can set a charactar as a delimiter and the incoming string is cut by this delimiter. the output is a list.
roman
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
I think it's splitfilename but i have some problems using it (sometimes it works very well but sometimes, i get segmentation error and Pd quit)...
João Miguel Pais a écrit :
I thought makefilename might help, but it only works for putting together, not taking apart. I'm a little rusty on string manipulation in Pd. Is there a simple way to set up something like this?
there's stripfilename from iem. there was also etter one that cut symbols trough a definable character, but I can't remember which it was.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Romain Vuillet wrote:
I think it's splitfilename but i have some problems using it (sometimes it works very well but sometimes, i get segmentation error and Pd quit)...
this is known. however i cannot reproduce it right now with current CVS (which makes it hard to fix the error). which version of iemlib do you use?
João Miguel Pais a écrit :
I thought makefilename might help, but it only works for putting together, not taking apart. I'm a little rusty on string manipulation in Pd. Is there a simple way to set up something like this?
there's stripfilename from iem. there was also etter one that cut symbols trough a definable character, but I can't remember which it was.
hmm, you can set the separator in iemlib's [splitfilename], either with a creation argument of by sending it a [separator $1( message.
mf.adr IOhannes
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 21 Nov 2006, at 11:41 AM, Chuckk Hubbard wrote:
2 problems: a) any numbers in the file path are replaced with the text "float", b) it would be nice for it to know whether ".ji" was already on the end, because if someone types a name for save-as and doesn't put .ji on the end, it lops off the last three characters as though they were ".ji".
[split_path] | | | [splitfilename .] | | | the filename without the extension | the path as a symbol
should help decode the output of [savepanel] and avoid the 'floats'
both are in Pd-0.39 extended
simon
On 21/11/06, Chuckk Hubbard badmuthahubbard@gmail.com wrote:
My program saves .ji files, and separately saves .trs and .prs files with the same name as the chosen .ji file. Same thing when it loads a .ji file. Right now, I have something like the attached file. It should take the input "filename.ji" and output "filename". 2 problems: a) any numbers in the file path are replaced with the text "float", b) it would be nice for it to know whether ".ji" was already on the end, because if someone types a name for save-as and doesn't put .ji on the end, it lops off the last three characters as though they were ".ji".
I thought makefilename might help, but it only works for putting together, not taking apart. I'm a little rusty on string manipulation in Pd. Is there a simple way to set up something like this?
It's sort of overkill, but I've just discovered the magic of py/pyext. You could easily do the string manipulations in a python script.
Maybe overkill, but pretty sweet :-D
-Chris Bryan