Get title from each file and renaming each file

I have word files in a folder. (If it would be better, I can convert them to excel or html.) To clarify:

  1. The files are uneven. While they have columns, they have different numbers of them, so these are not excel files that can be “merged.”

  2. The files are named in a way that does not show their content. This is the problem: 1 misc.xlsx …

  3. Sometimes the 1st or 2nd rows contain a word or two that is irrelevant.

  4. By the 3rd row, there is a heading, in bold. I would like to be able to grab this and rename the file with that heading. So 1 misc.xlsx becomes 1 MyHeading.xlsx

  5. Is is possible to spool through the files and rename or copy each file to new one,but now with a more informative name?

Steve

@Selster welcome to the KNIME forum.

There was a debate about a similar scenario and I create a sample workflow using an R package. Maybe you could try and reuse that.

1 Like

Hello @Selster,

to start from end. No. To access Excel data you have to read it inside KNIME (at least without using Python or R) so you have to read all files you would like to rename with info from it into KNIME.

To make that work smoothly there are couple of things to do:

You can check this workflow on reading Excel Files to help you started:

Give it a try and if any questions feel free to ask :wink: Welcome to Community!

Br,
Ivan

1 Like

Hello ipazin, I have downloaded your workflow. Using the bottom of your three flows, I get as far as the Excel Reader which refuses to execute, even though I have put in the path my local folder? Thank you very much, Steve

Hello @Selster,

what is the error you are seeing? If you are reading only one sheet from each Excel file you can modify bottom flow in a way to remove outer loop and Read Excel Sheet Names (XLS) node.

Br,
Ivan

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