Line Reader node failure

Hi,

When using the Line Reader node, I found that the node will fail when the file name contains blank (space) characters (ex: ‘dummy .txt’). I’m using Knime 4.1.0. Could you confirm you can duplicate the bug?

Regards,
Claire

Hi there @Claire,

just tried it out and works for me. What error message do you get? Can you share example workflow where it fails?

Br,
Ivan

Hi @Claire,
for me this also works on macOS. What operating system are you on?
Kind regards
Alexander

Hi,
Here is the message I got: 'ERROR Line Reader 0:425:424 Execute failed: Illegal character in path at index 77: /site/tl/home/XXXXX…/CL exempleBug.txt.

Find attached a workflow example with 2 files: 1 works, the other one does not.
Regards,
Claire
'Check_Bug.knwf (22.6 KB)
CL exempleBug.txt (13.9 KB)
CL exempleBug.txt (13.9 KB)

Hi,
your Line Reader is configured to use a “Custom URL”. But the file name coming from the File Upload Widget is not a proper URL (no “file:” prefix and no encoding for special characters like space). Can you use “Local File System” instead? It should also work and should take normal file paths.
Kind regards
Alexander

Hi,
I used this configuration because my original workflow contains automated testing and in that case I do not execute the widget. The variable for the file name in the Line Reader node has the format knime:/knime.workflow/Data/Validation_Data/My_inputFile.txt (see screen shot). If I do not use this setting, the testing branch will fail. It won’t find the file.
Note that the exact same setting works just fine when I use an Excel Reader node (my workflow allows for 2 different types of input file).
Regards,
Claire

Hi,
I see the problem and will ask our developers about this. In the meantime, can you use a String Manipulation (Variable) node to turn your path into an URI? Just replace spaces with “%20” and append “file:”. Does that work?
Kind regards
Alexander

Hi Alexander,
Could you give me the statement I should use?
Thanks,
Claire

Hi,
sure, it should be something like this:

concat("file:", replace(<yourvariable>, " ", "%20"))

Kind regards
Alexander

Which setting should I use in the Line Reader node then? ‘Read from Local File system’ with variable inputFile (URL)? or custom URL? So that it works in both case (user input - widget, and automated testing - no user input)? I’m lost.

Thks,
Cl

Hi,
then you can keep using the Custom URL setting.
Kind regards
Alexander

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