Creating one graph from multiple files?

Please help a chemist with poor data handling skills :slightly_smiling_face:

From my HPLC I get chromatograms exported as csv files as simple X,Y coordinates in two columns. The number of chromatograms varies from day to day depending on how many samples I run, but I always collect them in a new folder. I usually load the csv files into Excel where I normalise the Y axis and then plot all of the chromatograms in one X,Y graph.

It is a bit tedious doing this manually every time so, upon a friendā€™s recommendation (to avoid vba coding), I tried to get knime to help me do it automatically.

I can get all of it done for one file, but canā€™t figure out how to do it with multiple files and stack them in the same graph (or output to Excel). I have asked google, ChatGPT and looked on the forum here, but not found a solution that I got to work. I guess that I need some sort of loop, but which one, and how, is not quite clear to me when the amount of csv files in my folder varies and I add an extra column to my original dataset for the normalisation of the data.

I hope my question is clear and that I have not overlooked too many of the same topics here on the hub.

Br,
Anders.

sounds not to difficult:

  1. assuming that all files are under a certain parent folder: the ā€œList Files/Fordersā€ can find all csv files even in subdirectories
  2. with the table of all files a ā€œTable Row to Variable Loop Startā€ is fed.
  3. which gives out a path information for each iteration as variable
  4. with this a CSV Reader node is controlled
  5. ā€˜loop endā€™ unions all CSV Files to one table
  6. an additional column is necessary to distinguish the files (I used the file name)
  7. then the table is pivoted by the files
  8. a line plot is fed with this table
    be aware that there is a limit of max columns (if I am not mistaken of about 250)

    Chromatograms.knwf (23.8 KB)
3 Likes

I finally found time to sit down and try it out and it works :slight_smile: Iā€™m very happy to have made my first useful knime workflow! Thank you for your help! :slight_smile:

1 Like

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