-1

Im planning to create a freeware software with the working title "RaMoRD" - Rename and Mirror or Remove Duplicate Files. Like the name suggests it should be able to mirror folders/files from one folder to another and skip or rename duplicate files with different file names between source/target folder. Another different feature should be to find all duplicates(with different file names) in a specific folder and its subfolders and give options like remove or remove but create relative link to the remaining file. Another different feature should be to "optimize" file names by configurable rules in folders and subfolders. Im currently defining requirements and possible project risks.

Now the question is about the renaming function: Lets say I have a folder with music videos. There are the files: [GroupX] Rammstein - Sonne[720p].avi and Sonne%20Ramstein%20[480p] (live).mp4

The software should be able to auto-process the file names to something like: Rammstein - Sonne [GorupX][720p].avi and Rammstein - Sonne (live)[480p].mp4

the rules could be something like: -Find "_" replace with " " -Find "%20" replace with " " -Find "." replace with " " exclude extension -Find all "()" Move all to end -Find all "[]" Move all to end -Find "*-" in first 3 Bytes remove if found -Remove multiple " " in a row -Find " " in first byte or last byte remove if found

-Check for similar terms ignore terms in () or []. If a identical or similar term is found give options select "TermA" "AddSomethingInBetween" select "TermB"

Now really the question: -How do I identify a term like "Rammstein" and "Ramstein" to be similar in c#? I could think of creating an algorithm myself, but there is probably a better and faster standard solution I dont know of.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
user1550097
  • 129
  • 1
  • 11

1 Answers1

0

you could try implementing a search based on the Levenshtein distance like explained here Levenshtein to Damerau-Levenshtein

you can tweak it well enough to identify Rammstein and Ramstein and Rammsten as similar strings.

Community
  • 1
  • 1
Vland
  • 4,151
  • 2
  • 32
  • 43