Renaming files by their content

Placeholder

Written By Logiks Solutions

Last updated About 24 hours ago

What this does

You pick a folder. The add-in reads every file in it, asks the AI for a filename that matches the content, and renames the file accordingly. It is meant for batches like "scan_0043.pdf", "Document (7).docx", "untitled.txt" – files whose names say nothing about what is inside them.

Where to find it

Home tab ▸ Logiks AI Assistant group ▸ Task menu ▸ AnalyzeRename Files

[IMAGE: excel-menu-analyze-en.png – the "Analyze" submenu with its three entries]

Copy the folder first

This is the most important sentence in this article: files are renamed in place. There is no preview of the new names before it happens, and there is no undo. Once you confirm, the add-in works through the folder file by file and renames each one immediately.

So make a copy of the folder first and run the feature on the copy. If the result is good, delete the original. If it isn't, you still have it.

The form says so itself: "Files are renamed in place. Use a copied folder if you want a backup first."

Which files are included

Only these types: .pdf, .docx, .doc, .txt, .rtf, .ini, .csv, .log, .json, .xml, .html, .ht. Everything else in the folder is left alone.

Subfolders are not included. Only the top level of the chosen folder is processed. Once you have picked a folder, the form tells you how many supported files it found.

Filling in the form

[IMAGE: excel-rename-form-en.png – the "Rename files from their content" form]

  • Folder to rename – pick it with Browse. The file count appears underneath.
  • Instruction preset – a prepared naming rule from the library. "No library configured" means none is set up; that is not an error, you simply write the instruction yourself. Edit library lets you create your own presets; each line has the form Title|Instruction.
  • Naming instruction – your own rule. It takes precedence over the preset. Keep it short and unambiguous, for example: [YYYY-MM-DD] [Main Topic] - [Document Type].
  • Output language – the language the generated names should be in. This field cannot be empty.
  • Use reference document – if ticked, you then select an additional file. Its content is passed to the AI alongside every file. Useful when the names should match a list, a project plan or a naming convention.
  • Use OCR for PDFs – for scanned PDFs with no text layer. Without OCR the add-in reads nothing from them and cannot form a name.

The confirmation before the start

When you click Rename files, one last question appears: "Rename N file(s) in this folder?" – with the folder path underneath. Read both. The count and the path are all you get to see before the run; nobody shows you the new names in advance.

From here on: OK starts it, and each file is renamed as soon as its name has been decided.

During the run

A progress window shows the current step – "Reading: …" and "Renaming: …". You can cancel there.

Cancelling only stops the remaining files. Everything renamed up to that point stays renamed. The message gives you the number: "Operation aborted by user after N files."

How the names are built

  • The file extension is kept as it was. A PDF does not become a text file.
  • Characters Windows does not allow in filenames are removed.
  • If the name already exists in the folder, a number is appended: Name (2).pdf, Name (3).pdf and so on. No existing file is overwritten.

The result: the mapping list

At the end you get a summary with Processed files, Renamed successfully, a list of Mappings (old name ⇒ new name) and, where applicable, Errors. The same list is then in your clipboard – the message tells you so.

Paste that list somewhere straight away, into an empty worksheet or a text file. It is the only record of what each file used to be called. As soon as you copy anything else it is gone – and with it your ability to trace things back or rename by hand if you have to.

When individual files fail

The run does not stop; the affected file simply keeps its old name and appears under Errors. Common reasons:

  • read failed – the file is damaged, password-protected, or currently open in another program.
  • empty or unreadable content – typically a scanned PDF with no text layer. Try again with Use OCR for PDFs ticked.
  • AI service error – a temporary connection problem. You can run the folder again afterwards; note that files already renamed will then get a new suggestion based on their new name.
  • the AI service returned an empty name or sanitized filename empty – the instruction was too vague or the content gave too little to go on. Make the naming instruction more concrete.

A practical routine

  1. Copy the folder.
  2. Work with a handful of files in a test folder until the naming instruction gives you what you want.
  3. Then run the real batch.
  4. Save the mapping list out of the clipboard straight away.
  5. Check the result, and only then delete the original.