I’m reading a “table”, written in .txt, with a CSV Reader node in KNIME 4.7.7.
This table was generated by a tool I have no control over (so I cannot change the format)
The format of the table is as follow:
Header1 Header2 Header3
ID0001 2.54 str text
ID0002 5.87 str text
ID0003 0.25 str text
No quote, no delimiter, no “RowID” header, or white space before “Header1”.
While using the “Autodetect format” feature, i’m missing a header:
Without the “Has column header” option, here is the result:
In older version, the table is read properly though:
Using a file reader gives the same result.
Any solution to this except post-processing the table after reading it ?
encoding is same in both cases? Anyways hard to tell just be looking. Best would be if you can share the data (leave only headers and 2-3 rows changed with dummy numbers) and someone can give it a go. I personally still use 4.7.7. so I can give it a try with that version. That is the one you are having troubles with if I got it right.
Thank you for your reply !
As you requested, here is the file.
csv-reader_change.txt (89 Bytes)
Indeed the encoding remains the same.
here is what I get with both CSV and File Reader nodes:
Node that Column delimiter is whitespace and Support short data rows option is checked as nodes recognized only 3 column headers vs 4 columns of data. Additionally you can check Fixed Width File Reader node if your system produces such an output.
Thank you for your reply.
This behavior is precisely my issue. Is there no way for the CSV reader in 4.7 to guess from the input that a header is missing, like it used to do in earlier versions of KNIME ?
I get the exact same output as you (as shown in my previous screenshots), and compensated by adding post processing to this txt file, in order to get the format I need. I wanted to know if there was any way to avoid this post-processing?
ok. My bad. I get it now. You can use File Reader (Complex Format) node and it will give you your desired table format without need to do post-processing.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.