you can dynamically assign a filename to an XLS Writer node using Flow Variables. Assuming you found out how to use Flow Variable, your challenge may be to generate the timestamp. Here is how to do it:
KNIME has a Time Generator node. If you setup this node to generate one single row and tick "Use execution time as starting time", as a result you will get a single row table with the execution date/time.
With it, you can use the Date FIeld Extractor and Time Field Extractor nodes to extract Year, Month, Day, Hours, Minutes, Seconds and Milliseconds.
Add then a String Manipulation node to convert these values from int to string (use the string() function) and concatenate them all (using the join() function).
The result will be a timestamp string you can useĀ to appendĀ to your <filename> (use another String Manipulation node) to generate the unique filename you need.
Hope this makes sense, otherwise feel free to ask again here.
Very simple example attached, using a Java edit variable node to create the timestamp.
// Enter your code here:
//Replace this with whatever - possibly an incoming flow variable
String fname="C:\\Path\\to\\my\\output\\filename";
// See https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html for format codes
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy_HH-mm-ss.SSS");
out_timestamp = sdf.format(new Date());
out_filename = fname+"_"+out_timestamp+".xls";
Hopefully that is reasonably modifiable to what you want.
Check out https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html for the format options.Ā 'new Date()' gives the current date/time.
this one really helped me! I was curious if its possible to change the code a little bit to get the date of one week earlier.
To make this more clear: Every week I create an csv output with the dynamic filename and te next week I need this file as input to run the workflow again. I would like to use this code for writing as well as reading the csv.