I have files with filename with a date. I want to turn the date part of the filename into a column as part of the table. The filename looks like this NUMB_ASSC_FEBRUARY 04 2020. I want to add a new column to the table with only the date part of the filename. Here is the flow I created:
Can you upload that workflow? It would make things easier for those of us who are using a newer version of KNIME that has changed the way these nodes behave.
Hi makawhy,
perfect case for the Palladian Date Extractor:
It’ll just automatically recognize the date from the file name without any fiddly configuration (example workflow here on my NodePit space)
In case you haven’t yet, you can get Palladian from here:
– Philipp
Hello @makawhy,
and welcome to KNIME Community!
One way to do this is to extract date part from file name in new flow variable using one of variable nodes - String Manipulation (Variable) or Variable Expressions or Java Edit Variable (simple). You can choose one that you are comfortable with. If your file names always start with NUMB_ASSC then simple substring function will do it. Once you have information you need as flow variable use Variable to Table Column to add it as new column after Excel Reader.
If possible I suggest to use latest (4.3.2.) KNIME version.
Br,
Ivan
Thanks for your help. Can you please give an sample of how the substring function expression should look like using String Manipulation (Variable). I’m new to this. Thanks
Thanks a lot, Phillip! I’ll go ahead and download Palladian. I’ll let you know if I have further questions.
Hello @makawhy,
as said if file names always start with NUMB_ASSC_ then this expression will do it:
substr($${Scolumn1}$$,10)
Instead of column1 you’ll add name of your flow variable. Note that you can insert flow variable into expression by double clicking on it.
Br,
Ivan
Thanks @ipazin! This works perfect. I appreciate your help!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.