Extrakt two variables from .txt files in a folder and combine with a third variable (time) given in the file name

It sounds like you have three elements to consider

  1. the file name (you can extract that by using a list file node (and manipulate it later)
  2. the ‘header’ if indeed you file contains the information you mentioned above. The question is: can you separate the header lines from the rest of the data by splitting the file in half. You would initially load the file with File Reader as one single line, drop the data and split the header lines by “:” to get the data into columns
  3. the data itself. You would have to determine where the data starts and read the txt file starting with the respective line (leaving out the header)

Then you would have to combine the three elements back together. Do this with a loop and you can easily process a lot of files.

Sounds complicated but is actually quite doable thanks to KNIME. Maybe you upload some examples and tell us how your output would look like.

1 Like