the following question: I would like to add a column to a table that I have read (via File Reader) and edited with Knime, where in each row of the new column a timestamp is written, which refers to the date and time when the read file was originally created. (So the same content in each row of the new column.)
Would be great if there someone had a suggestion .
@mlauber71 & @ipazin : After some delay, thank you very much for your support!
I don’t think I had formulated the question completely: I wanted to automatically set timestamps in the rows of a table if there are several tables or files in a folder, so that the completely merged table shows which rows were written when. My mistake .
In the meantime, I have also managed to develop a workflow for this (see below).
I have a question: I would like to upload it to public KNIME hub, i.e. make it generally accessible. What is the best way to select example files, because the ones on my computer won’t work for everyone?
Hi @Christian_Essen , if I understand correctly, you just want to capture the current timestamp at a particular stage of the workflow, correct?
I have a component that I created that retrieves the current timestamp. It returns your local time as well as utc timestamp. It also returns them as timestamps and string format (in case you want to append the timestamp to file names, column names, etc).
It returns them as variables. You can add them as column via the Constant Value Column if needed.
@bruno29a : Thank you very much for your support . Unfortunately, it’s not quite what I had been looking for ("… which refers to the date and time when the read file was originally created.")
@ipazin : Thanks again for your great support .
When I said that the file does not work for everyone, I meant the fact that the file path refers to my local file system. In the meantime, however, I have learned from your post that you can then simply select “Relative to” “Current workflow” as parameters. However, I then get an “Illegal char” error message (as described in the “Shutdown problem” thread).
Hey @Christian_Essen , sorry I misunderstood. I thought you wanted to capture the current timestamp during execution, I thought you wanted to know when the file was read, kinda to track execution time or something, and also in your clarification, you mentioned “merged table shows which rows were written when”. So based on that, the idea would be to capture the current timestamp at the proper stage of the workflow, and add the captured timestamp as column with the Constant Value Column node.
If your issue is still not solved, what do you need?
as explained in other topic you can copy files into data folder within workflow directory and use Relative to path with Current workflow data area option to make your workflow reproducible (Added this info one more time for others who bump into this topic.)