File reader node not working with flow variables (new question)

HI there,

it seems there has been a similar question already, unfortunately it does not solve my problem.

I am using the Java Edit Variable Node to create a flow variable that attaches the current date to my filename so that I dont have to change that every week (as I am reading this file weekly)
afbeelding

The Node contains the following code where I use double slashes to refer to the file:\\
String pathname=“C:\\Knime\\Test\\”;
String fname=“testing”;

SimpleDateFormat sdf = new SimpleDateFormat(“yyyyMMdd”);

out_timestamp = sdf.format(new Date());
out_filename = pathname+out_timestamp+" - “+fname+”.csv";

In the preview the file reader can read the csv but while executing I get the error message
WARN File Reader 0:1 Errors loading flow variables into node : Coding issue: Cannot create URL of data file from “C:\Knime\Test\20201120 - testing.csv”’ in filereader config

I treid to use the csv reader but I cannot read the csv file. I tried different configurations but its not resulting in the good output.

Does somebody have an idea how to solve this?

Thanks in advance!

This is not the solution to your problem but why don’t you use the date&time input variable node using the execution date?

Hi kowisoft,

how do you mean? I would like to use the flow variable to get the file location with the present date. I don’t know how I should use the Date&Time input variable node to do that

Dear Francesca,

you can use a combination of the date&time input node (which can also create variables without input) with the Create File Name node. See below / attached workflow

28878

Does that help?

Phil

1 Like

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