Line reader flow variable for file selection issue

Hello there.

I am having issue with the line reader node. Specifically I am unable to set a flow variable for file selection (both in variable settings next to browse button and flow variables tab).

When I open the window to select my flow variable it shows “no matching vars”.

How can I use flow variables with line reader node?

p.s. I am using KNIME version - 4.3.1 on windows
An example of my flow variables is:
“URI” (STRING: file:/D:/MolPortFiles/import_stats/MolPortFiles/report_sp_01.06.2020-12.08.44.txt)
“Downloaded” (BOOLEAN: true)
“Parent folder” (STRING: D:\MolPortFiles\import_stats\MolPortFiles)
“File name” (STRING: report_sp_01.06.2020-12.08.44)
“File extension” (STRING: txt)
“File path” (STRING: D:\MolPortFiles\import_stats\MolPortFiles\report_sp_01.06.2020-12.08.44.txt)
“RowID” (STRING: Row1230)
“currentIteration” (INTEGER: 0)
“maxIterations” (INTEGER: 181)
Loop-Execute
Loop (0)
“CurrentFTPFolder” (STRING: /data/importupdate/import/import-statistic/)
“file_path” (STRING: D:\MolPortFiles\import_stats\MolPortFiles)
“file_extension” (STRING: )
“file_name” (STRING: MolPortFiles)
“parent_folder” (STRING: D:\MolPortFiles\import_stats)
“directory” (STRING: file:/D:/MolPortFiles/import_stats/MolPortFiles/)
“knime.workspace” (STRING: D:\knime-workspace)
“Credentials” (CREDENTIALS: Credentials: Credentials)

Hi
Looks like the Line Reader requires the data type path for the variable.
Have you checked that you have the path data type? If not there are nodes to convert e.g. string to path
best regards

1 Like

Hello @AAuzins,

and welcome to KNIME Community!

New File Handling framework was introduced (out of labs) with KNIME version 4.3.0. See here for more info and way of working with it:

https://docs.knime.com/latest/analytics_platform_file_handling_guide/index.html#compatibility-and-migration

Br,
Ivan

Yes you are right, using String to Path (Variable) node I was able to change File path type form string to Path and now it works.
Thank you for your help. Frustrating that Line reader need this extra conversion while all other readers can use string just fine,

Hello @AAuzins,

Maybe you can try to create path flow variable instead of string ones so you don’t need this extra conversion. How do you get string flow variables? Also this is not just about Line Reader. All nodes migrated to new file handling work with path flow variable - Excel Reader, CSV Reader

Br,
Ivan

1 Like

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