CSV Writer errors out when filename comes from a variable

When CSV Writer node is configured to use filename from a variable, I get this error consistently:

WARN CSV Writer 0:570 No destination location provided! Please enter a valid location.

This causes the workflow to fatally error out when ran from the command line. This is the error message:

JVM terminated. Exit code=4
/opt/knime/knime_3.5.3//plugins/org.knime.binary.jre.linux.x86_64_1.8.0.152-01/jre/bin/java
-server
-Dsun.java2d.d3d=false
-Dosgi.classloader.lock=classname
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-Dsun.net.client.defaultReadTimeout=0
-XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot
-Xmx2048m
-Dorg.eclipse.swt.internal.gtk.disablePrinting
-jar /opt/knime/knime_3.5.3//plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
-os linux
-ws gtk
-arch x86_64
-launcher /opt/knime/knime_3.5.3/knime
-name Knime
--launcher.library /opt/knime/knime_3.5.3//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.400.v20160518-1444/eclipse_1617.so
-startup /opt/knime/knime_3.5.3//plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
--launcher.overrideVmargs
-exitdata b95001e
-reset
-application org.knime.product.KNIME_BATCH_APPLICATION
-workflowDir=/home/peleitor/knime-workspace/tesis/integration/nerrel_article_grabber_pubmed
-workflow.variable=download_dir,/tmp/nerrel_download,String
-workflow.variable=year_month_from,1980/01,String
-workflow.variable=year_month_to,1980/01,String
-workflow.variable=output_file,,String
-vm /opt/knime/knime_3.5.3//plugins/org.knime.binary.jre.linux.x86_64_1.8.0.152-01/jre/bin/java
-vmargs
-server
-Dsun.java2d.d3d=false
-Dosgi.classloader.lock=classname
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-Dsun.net.client.defaultReadTimeout=0
-XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot
-Xmx2048m
-Dorg.eclipse.swt.internal.gtk.disablePrinting
-jar /opt/knime/knime_3.5.3//plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar 

I’ve tried workarounds like specifying a name and then re-specify to use a variable.

Regards

Maybe you could take a look at the attached example. It uses the absolute path provided by KNIME and a relative path towards the workflow. The absolute path might give you an idea how your operating system stores the paths and how KNIME would read them.

The relative path should work regardless of the OS.

knime://knime.workflow/export_relative_path.csv
=> file would be stored in same path as the current workflow

knime://knime.workflow/…/data/export_relative_path.csv
=> file would be stored in a folder data that sits on the same level as the current workflow

Maybe you can use this system to construct your file names and paths.

18

kn_example_csv_path.knwf (16.9 KB)

I see your point, but in this case I need the full file path to come as a parameter (from the command line).

That is why I use a variable.

Regards