3

I have two 'context level'macros defined in my Rapid Miner process as -

from_date = //some date//
to_date =  // some date//

In the Rapid Miner process, I'm using the Execute Program operator. This operator should accept the two macros (defined earlier). I'm providing the below command in command field of the parameters

C:\test.bat %{from_date} %{to_date}

test.bat Windows batch file content -

C:\mongodb\bin\mongoexport --db db1--collection c1 --query "{'logentry.date': { '$lt': {'$date' : ISODate('%1')} , '$gte': {'$date': ISODate('%2') }}}" --out C:\test1.csv --type csv --fields id,name

Execute Program should perform action defined in the Windows batch-file (i.e. processing should be done and results are to be saved to the 'CSV' mentioned in batch file). But when I use the above command and run the Rapid Miner process, CSV is shown with blank content.

I want to know how we can pass a batch file with context macros as parameters to the command field in 'Execute Program' operator.

From command line, I am able to run the the 'test.bat' file with date parameters - as shown below

c:\MyTests>test.bat 2016-07-28T11:58:59.633069Z 2016-07-19T12:42:00.248412Z

After running the above command successfully, the output is displayed in CSV

Any help is greatly appreciated. Thanks !

Sam Denty
  • 3,693
  • 3
  • 30
  • 43
user2014
  • 171
  • 1
  • 14
  • Is there a question you need answered? – Squashman Sep 28 '16 at 14:53
  • @Squashman - Yes please – user2014 Sep 28 '16 at 14:59
  • I do not see any documentation on Rapid Miners website on how to pass variables you create within the program to another program you are executing. But the documentation does say: **In Windows / MS DOS, simple commands should be preceded by 'cmd /c'**. – Squashman Sep 28 '16 at 15:11
  • Looks like Rapid Miner has their own community forums. http://community.rapidminer.com/ – Squashman Sep 28 '16 at 15:17
  • Thanks @Squashman, i posted my question in RM forum. – user2014 Sep 28 '16 at 15:30
  • @user2014, did you ever resolve this issue? Can you post the answer here? – jwdonahue Jan 14 '18 at 02:34
  • Have you checked if your macro is actually in the correct date format? Maybe try the generate macro operator and hardcode the date for testing purposes. RapidMiner sometimes does weird things if you have an Attribute as Date type. – Barry Jan 06 '20 at 14:47

0 Answers0