STRUCTURING DATA, DATA NOT PROPERLY ARRANGED IN ROWS AND COLUMNS

Good day KNIMERS,

Please i need guild on how to structure this txt data. it is really scattered but dont want to use code for it . i need the data to be properly arranged in rows and column.

kindly find attached to the document

Thanks

flare new.txt (57.7 KB)

Hi @ajisafeadeoye , as this appears to be a fixed-width field file structure, I think a File Reader and a Cell Splitter By Position should be a starting point.

image

In the File Reader, untick the column header box

To determine the configuration, you will need to open the file in an editor that can show you the cursor’s column position and find where each field ends.
e.g. in Visual Studio Code it might look like this:

Once you have the end positions for each column, you can put the list in the Cell Splitter By Position node

From the rows I inspected, and making guesses, I believe that the following end positions work for the sample file:
12,18,23,28,37,61,64,72,86

You will then have to give each column a name
e.g.
c0,c1,c2,c3,c4,c5,c6,c7,c8,c9

There should be one more column name than there are split positions, since you are defining the points where data splits, rather than the start or end of every column.

image

Your data should then be in columns which you will then need to decide what to do with. Hopefully you have some details of what each column represents:

Edit: Looking further down the file, I realised I had missed another column, so I think you may need a cell split such as:

12,18,23,28,37,61,64,72,79,86
and then you’d need an additional column
c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10

Obviously you will need to check if the cell splits are correct and work for you!

4 Likes

Thank you so much @takbb . You are indeed a legend .

We have more to do with KNIME , this is lovely

Your answers are very explicit.

1 Like

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