Can knime help me input words in excel automatically

As I have so many excel files, I would like to use concatenate function to combine all files/

However, all of the excel files have no date.

Can Knime help me input the date in each excel file?

Each excel file has its own date as its name.

Hi @HKuser

Here are the general steps that I’d try:

  1. Use a list files node to list all the files you want concatenated
  2. Start a loop that loads the files one at a time
  3. Extract the file name from the file URL using the cell splitter node
  4. Convert file name to a variable
  5. Add the value of this variable to your data table using the constant value node
  6. End the loop while concatenating the data
3 Likes

You could use these examples to try @elsamuel approach

1 Like

Thx for your reply! I am not quite sure how to do in the step three?

I would’ve used a Chunk Loop Start node to isolate the individual rows of URLs generated by the List Files node.

The Output of this node gets split into 2 branches:

  • the 1st branch goes to a Table Row to Variable node which converts the URL into a variable which can then be used to tell an Excel Reader node which file to grab.
  • the 2nd branch leads to a Cell Splitter node with an appropriate delimiter such as the forward slash, which allows you to isolate the file name portion of the URL. You can always do more processing to get the format exactly the way you want it.
    • You can convert this to a variable and use a Constant Value Column node to append a column to the output of your Excel Reader node in which which each row contains this value.
  • A Loop End node concatenates all the data.

image

The workflow below achieves the same results, but feels a little more clunky to me:

You download both workflows form here and have a look around:

There are probably other ways to achieve this, but these workflows are what came to mind first.

3 Likes

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