"Is there a way to change extension in Loop_Files?"
Charles54
New Altair Community Member
Hello all,
I am using a Loop_Files operator on some .csv files and want to save the output with the same file names, but a different extension.
I have tried using Generate Macro, but it seems that the string functions (such as "replace") are not available.
Any ideas on how I might accomplish this would be greatly appreciated.
Thanks, Wes
I am using a Loop_Files operator on some .csv files and want to save the output with the same file names, but a different extension.
I have tried using Generate Macro, but it seems that the string functions (such as "replace") are not available.
Any ideas on how I might accomplish this would be greatly appreciated.
Thanks, Wes
Tagged:
0
Answers
-
Hello
The replace function is available with Generate Macro. Not sure what you can't get it to work but there's an example here that you could copy to get you on your way.
http://rapidminernotes.blogspot.co.uk/2013/10/bulk-export-of-processes.html
There are also some additional generate macro related posts here
http://rapidminernotes.blogspot.co.uk/search/label/GenerateMacro
regards
Andrew0 -
Awesome! Thanks Andrew, that did the trick.
The problem was that I did not have "%{newFileFolder}" in quotes -- and I am not really sure why it is supposed to be in quotes.
Funny, I have used your rapidminernotes blog in the past and I googled a different post from your blog searching for a result to this problem. Somehow, I didn't find this one. Anyway, saved me from considerable frustration, so thanks again.
Cheers, Wes0 -
Hello Wes,
Glad it helped!
I suppose the reason the macro needs to be in quotes is to force it to be a string. If the macro value contained spaces then there might be low level chaos in the code because it would get confused about where the string ended.
regards
Andrew0