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.
Problem with the standard and the Execute Program Operator
Alpalentless
Member Posts: 1 Learner III
Hello people,
I'm currently working with RapidMiner 6 and at the end of a process I have to pipe out the Data Set to a Java Program.
In the documentation says that a process like : "Write CSV (fil) -> (in) Execute Program" will send the data set through the standard output to the program I'm executing, but the the process keeps failing and returning an error.
I'm using the following code in Java
What am I doing wrong here? D=
I'm currently working with RapidMiner 6 and at the end of a process I have to pipe out the Data Set to a Java Program.
In the documentation says that a process like : "Write CSV (fil) -> (in) Execute Program" will send the data set through the standard output to the program I'm executing, but the the process keeps failing and returning an error.
I'm using the following code in Java
public class WakaMain {And every time I run the process I get the following error:
public static void main(String[] args) throws IOException {
ArrayList<String> input = new ArrayList<String>();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String inLine = br.readLine();
int i = 0;
while(i < 10){
input.add(inLine);
inLine = br.readLine();
i++;
}
br.close();
writeStream(input);
System.out.println("Done: "+input.size()+" Inputs");
}
public static void writeStream(ArrayList<String> in) throws IOException{
FileWriter fw = new FileWriter("StreamWriteOutput.csv");
PrintWriter pw = new PrintWriter(fw);
for(int i = 0; i<in.size();i++){
pw.println(in.get(i));
}
pw.close();
}
}
What am I doing wrong here? D=
0
Answers
you can't pipe from Java via cmd to a new Java process it seems (I never tried that). Probably the easiest way is to actually write the .csv file and have your program read it again instead of relying on pipes. The tutorial process works because there the output is piped to a system tool (sort) directly.
Regards,
Marco