massive rename of songs; normalize song filename convert foriegn to english character
i have about 35k songs. some of them have foregin character like (¶,ö) in their filename. and some players like clementine, gmusicbrowser wont detect these songs.
so i need help to replace those forign char into their respective english char. thanks |
Hi
I've found the following: http://gordonazmo.wordpress.com/2011...from-filename/ I would change it a bit to work on nested folders and to test if it works for you: Code:
find /path/to/files -type f -print | grep [ÄÖÜäöü߶] | while read file; do N=$(echo $file | tr -cd '\11\12\40-\176'); echo mv "$file" "$N"; done If you are satisfied with the result do: Code:
find /path/to/files -type f -print | grep [ÄÖÜäöü߶] | while read file; do N=$(echo $file | tr -cd '\11\12\40-\176'); mv "$file" "$N"; done Be aware the characters are just deleted and not replaced. If you also want to change names of paths remove the "-type f" option of the find command. The command may take a long time to execute, you mentioned you have 35k songs. Just be patient. ;) |
You may also be able to do it with Thunar, the file manager used for xfce (you can use it without xfce), but you may have a lot to rename. I've used it with success for under 100 files.
Have you explored the rename command? |
Since they are music files, are you only concerned about the file names or do you also want to rectify the IDx tags?
If only file names, then the above solutions are good - however, if you're interested in fixing up the tags; I had a similar issue with around 25,000 MP3 files - I used a variety of tag editors on both Windoze and Linux (Ubuntu) clients - and I found an application called "Easy Tag" which did the trick quite well (sudo apt-get install easytag). It allows the modification of tags (batch entry too - which is useful with lots of files) and also allows renaming - with sub-directories etc, as required. There are a few "smarts" in there too which can help, depending on the situation. All up, I'd say it's worth a look. Cheers ... Bill |
If you use KDE, you can use krename for a "find and replace". All you would do is to do a search such as *.mp3 in either Konqueror or Dolphin and then select all. Then you can right click and select Action>Rename with Krename. You can set up a rule for each change and then run all rules at once. It offers a preview and also an undo command if something goes wrong.
|
Quote:
Quote:
rename, i forgot about it. thanks Quote:
thanks for the suggestion. Quote:
thanks |
Quote:
Code:
find /home/ununun/music/ -type f -print | grep [^[:print:]] | while read file; do N=$(echo $file | tr -cd '[:print:]'); mv "$file" "$N" ; done thanks |
i executed this script
https://github.com/bk322/bk-goodies/...filenames.bash what it did actually is move (mv) files of a directory to same file. i am staying calm :( now i have 34k songs. thanks |
Hi
you have said Quote:
"/home/manish/music/1/25/2/" concerning to write. |
btw use a backup before running such a command.
|
Quote:
Code:
ls -l /home/ununun/music/1/25/2/ |
???
|
Quote:
and i ls -l to show that it is not the case. |
and I guess you are using the id "manish" and have write rights to "/home/manish/music/1/25/2/"?
|
yes manish == ununun ; just avoiding extra information.
so whats wrong with the script. ps. i used conmv to convert to utf-8 character set at the time i downloaded these songs. |
All times are GMT -5. The time now is 08:19 AM. |