Dynamic filename output issues

I have a large file where I would like to output multiple XLS files, one file per customer with that customer’s name and YYYY-MM as the filename.

I have this quick workflow where I use a grouploop to start grouping customer by customer, and a string manipulation to make the filename. I then have that filename variable set as a flow variable. I’d like it to then write the individual files, only I cannot get the dynamic file naming to work. Am I using the loop correctly? This is my first time looping in KNIME.

I get this error, that the filename must be absolute, when I try to use the flow variable to name it. How can I save it locally on my computer? I tried adding a path on my computer to the filename flow variable in the string manipulation, but that gave a ton of errors. Thanks in advance for all of your help, Eric.

hi @ewhulbert ,

depending on your OS an absolute path looks either like
C:\WINDOWS\system32 (Windows) or /home/owner/ (Unix) so you’d have to create the appropriate file name.
Two potential solutions:

  1. Use the Create File Name https://kni.me/n/_XB1nUphPEUorP0T node or
  2. Use Write to → Relative To this file system supports relative paths

Hope this works for you.

Best,
Mark

1 Like

Hello @ewhulbert,

if you don’t need data for further processing I would go with Variable Loop End node. Also with String Manipulation you won’t create flow variable holding file name so you should use String Manipulation (Variable) node.

Check this topic:

Additionally I have done workflow example with latest KNIME version featuring path variables:

If you can update KNIME check it out :wink:

Br,
Ivan

2 Likes

Thanks gents, I got it working based on your feedback. For anyone interested, this is what my version looks like.

Loop_with_dynamic_filename.knwf (17.2 KB)

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.