I have a problem with the file reader node the white space didn’t align accordingly like in my raw data. Is their a perfect node reader for text file?
Raw Data text file-perfectly align with specific column -Contains hundreds of lines and comments
Here’s my output using Monarch. And I’m trying to parse the text file thru KNIME. If there’s a node equivalent or same with monarch parser? or even just the proper alignment of white spaces.
I tried Fixed Width File Reader but in my case it will not work.
Thank you in advance!
hi @seanmanzanilla ,
could you upload a test file? Some 20 rows will do, I think
Hi @duristef ,
Here’s my sample data and structure.
Sample Data.txt (9.2 KB)
I have to deal with text files like that at work. There’s two things you can do:
- Use the Fixed Width File Reader and set up the column widths manually
- Use the “normal” File Reader and read everything into a single column
then remove all duplicate whitespaces
finally use a Cell Splitter on that column to split the lines up into different columns
I went with the second way, because I also have an arbitrary number of header lines I need to get rid of.
The functions in the String Manipulation nodes are
removeDuplicates($yourColumn$) and possibly
Here’s my suggested workflow
KNIME_project5.knwf (13.0 KB)
I’ve set the width of the first columns only, leaving the remaining 14, that contain no blanks, in a single column, then I’ve split them using a blank as the separator. You’ll need to rename them by hand.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.