Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
[SOLVED] Macro + Path = Problem
Hi there,
I've got a problem modifying a path using "Generate Macro".
In the "File Loop" operator you get one (actually two) macro pointing the a folder (file_path and parent_path). If you want to modify this macro using "Generate Macro" you get a syntax error.
Example: suffix("%{parent_path}",10)
The problem is the backslash (\) in the path which will be interpreted wrong, but you can't escape it.. or can you?
Background:
I want to use the "File Loop" operator to read in a number of csv files in different subdirectories and store them in their respective folder.
Example:
"...\2012-05-02\file1.csv" ---> "...\myRepository\2012-05-02\file1.ioo"
"...\2009-10-31\file2.csv" ---> "...\myRepository\2009-10-31\file2.ioo"
Therefore I need the current directory (relative path), which I unfortunately isn't provided in "File Loop". Hence I tried to modify the macro "parent_path" (absolute path), which will lead to the error described above.
Cheers Q-Dog
I've got a problem modifying a path using "Generate Macro".
In the "File Loop" operator you get one (actually two) macro pointing the a folder (file_path and parent_path). If you want to modify this macro using "Generate Macro" you get a syntax error.
Example: suffix("%{parent_path}",10)
The problem is the backslash (\) in the path which will be interpreted wrong, but you can't escape it.. or can you?
Background:
I want to use the "File Loop" operator to read in a number of csv files in different subdirectories and store them in their respective folder.
Example:
"...\2012-05-02\file1.csv" ---> "...\myRepository\2012-05-02\file1.ioo"
"...\2009-10-31\file2.csv" ---> "...\myRepository\2009-10-31\file2.ioo"
Therefore I need the current directory (relative path), which I unfortunately isn't provided in "File Loop". Hence I tried to modify the macro "parent_path" (absolute path), which will lead to the error described above.
Cheers Q-Dog
0
Answers
I had the same problem. In the end I wrote a Groovy script to manipulate the contents of the macro to return the parts I wanted.
Regards
Andrew
// Edit
For everyone who's interested:
You beat me to it - I was about to post something similar
regards
Andrew