Text file - split to columns

Hello,

I have a text file (see attachment) and need to get this into a table. The issue I am having is that the data is not consistent across the file.

Each row starts with MAS. So, in the example, the final output should have only 3 rows.

What would be the best approach to do this?

Thank you much.

Example.txt (441 Bytes)

Hi @sw1336

To convert your input to an output with only 3 rows you can follow these steps.

afbeelding

Use a Rule Engine node to identify the start of every row, and create column (ID) with the unique id.
$Column0$ LIKE "MAS*" => $$ROWID$$

Next use the Missing Value node to add the ID’s to the associated rows.

Then use the GroupBY node with the option Concatenate (delimiter = " "), to create your outputfile

see: combine_rows.knwf (29.4 KB)

gr. Hans

3 Likes

Many thanks, @HansS! Let me work with this…

1 Like

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