create a directory

Hello everybody!

I need my workflow to generate directory. I know that topic has already be treated previously but there is no answer except: "create your own node", what I can't do right now.

I see two other options:

-Java, Perl, Python snippet

- External Tools

In both case, my problems is these nodes need an output what I don't need. I just want to take my table, in which there is a column that contains a number (the same for all the rows), and to use this number to create a directory.

Do you think there is a simple way to do that?



Can you not convert these numbers to a variable and pass this into the "Create Temp Dir" node to create different directory base names.


Or convert them to a variable, and pass them to a Java Edit Variable node configured with something like

String r=$${SOutputDirectory}$$;

boolean success = (new File(r)).mkdirs();
return r;

OutputDirectory is the full path to the directory you want to create, and is return unchanged by the above. (Configure the node to overwrite the OutputDirectory variable, and return a String type).

Obviously, you could do some manipulations on the string in r before creating the directory.

You can plug the output variable connection back into the variable flow variable port of another node, and simply ignore it from then on (Note that the destination node will then not run until the edit variable node has completed).


Yes Simon,  I could, but this node creates a temporary directory. I'd like the directory be in my /home. At present, all the directory it has created are in the /tmp and modify the destination directory doesn't seem doable.

I also tried try your suggestion. I get on compression error:

ERROR at line 14

file cannot be resolve to a type

What I don't understand is the number of lines

Hi, I've not solved this problem yet, so if someone has an idea, I'm very interrested!



The line numbers are sometimes confusing, I agree. But KNIME v2.6 will come with a completely revised Java Snippet allowing for syntax-highlighting, multiple in- and out-put variables etc. If you have copied the script into the Java Edit Variable node, you should be able to run it as it is; make sure the (global) variable has the same name and you use the File class instead of file.

yes, the problem was the lowercase. I forgot how much that's important in Java!

Thanks a lot