I have a question. I am looking for the possibility to add a column with a fixed value to my excel file. However this fixed value should come from the title of the excel file, for example: the file is called 20200605_921_TK.xlsx. I would like to add a column with the fixed value of 20200605, a column with 921 and a column with TK.
Can anyone help me out on this, if this is possible?
Welcome to KNIME forum.
First read your file with Excel Reader. On Excel reader configuration Flow Variable tab find FILE CHOOSER group and inside it pick path_or_url variable. In the empty box input desirable name, say MyExcelPath.
Then using Variable Expression node extract parts of the MyExcelPath in 3 different variables and use Column Expression to add them to the original file.
Write file with overwrite option with Write Excel Writer node.
The process is actually very straight forward. What you want to do is create a variable from the file name you read. Likely you will strip off the path of that variable to be left with just the filename. Then use a cell splitter to break the filename down by the underscore.