ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Rename files based on a list of similar names

(1/3) > >>

Jabberwock:
I sometimes have a bunch of, erm, obtained media files. The files in themselves are fine, but the filenames are often a mess (especially when Polish characters are involved). On the other hand, for most of them I can obtain a clean nice list of correct filenames. How to get the two together automatically? I guess a perl script that would look for most similar string might do, but it is not exactly trivial...

Is there a software that would rename a file to a name that is most similar from a list?

kfitting:
To get started, look up  "Levenshtein distance."  There are various algorithms in various languages (I found one in python, converted it to VB).  There are variations depending on speed vs fuzzy matching complexity.

Stackoverflow
How the algorithm works

skwire:
1) You have a list of files with names you don't like.
2) You have a text listing of filenames that you do you like.

How about an application with two listviews?  The list on the left shows your actual files and the one on the right is your text list.  For the listview on the right, you'd be able to move the entries up and down to match up against the ones on the left.  Once you have the names where you want them, click a button, and your original files are renamed.

skwire:
Actually, my favourite file renamer, ReNamer, can already do what you want.  http://www.den4b.com/projects.php

Rename files based on a list of similar names

Let me know if that doesn't cover your needs and I'll see about writing something custom for you.

AbteriX:
Actually, my favourite file renamer, ReNamer, can already do what you want. 
-skwire (June 27, 2010, 03:29 PM)
--- End quote ---
Please note that the list of "right" names have to be in the same order as the files to rename are listed in e.g. ReNamer.
Otherwise you get files with the right names but not the content the names may suggest.

Navigation

[0] Message Index

[#] Next page

Go to full version