Hi,
This is not really a TC question/problem but it is related:
I needed to change all accented characters in file names and directory names. (Using two incompatible languages PC's with an external USB disk). For example, change all occurences of é with e, of à with a, etc. in a full directory structure.
I used TC's _excellent_ FIND *é*.*, COPY to listBox, and renamed each file. This is a hell of a job. It made me think of writing a text editor that will read into itself all such files/directories, do the replace and then proceed to the actual rename.
This was too much work and I did the thing (manual rename) in about an hour using SHIFT-F6.
Does such an "editor" exist?
Anybody has a better idea on how to do that?
TIA,
EitanG
Rename - Replace a Char with another in all file/Dir _names_
Moderators: Hacker, petermad, Stefan2, white
2eitang
2. Select dirs/files to rename.
3. Call the Multi Rename tool (Files/Multi Rename tool, Ctrl+M)
4. type é in "Search for" and e in "Replace with".
5. Start!
There is currently no way to replace multiple strings at once. You'll have to repeat the procedure to replace all accented characters.
This will be possible in the next version:
Search for: é|à
Replace with: e|a
1. Search for *é* *à* and feed to listbox.Anybody has a better idea on how to do that?
2. Select dirs/files to rename.
3. Call the Multi Rename tool (Files/Multi Rename tool, Ctrl+M)
4. type é in "Search for" and e in "Replace with".
5. Start!
There is currently no way to replace multiple strings at once. You'll have to repeat the procedure to replace all accented characters.
This will be possible in the next version:
Search for: é|à
Replace with: e|a
Re: Rename - Replace a Char with another in all file/Dir _na
There is a little tool renamer what shall do the work for you.eitang wrote: change all occurences of é with e, of à with a, etc. in a full directory structure.
bkren -s "(.*)é(.*)" "\1e\2"
bkren -s "(.*)É(.*)" "\1E\2"
bkren -s "(.*)à(.*)" "\1a\2"
bkren -s "(.*)À(.*)" "\1A\2"
Put this code into a batch-file and execute it in the desired drirectory. The "-s" switch includes the subdirectories.
ATTENTION: You have to make sure to use DOS-charset (not windows). Otherwise you wll get strange results. Easiest way I think is to use the DOS editor (you get on the console with typing edit).
Anyway - you should make some tests first in a test folder.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
Sheepdog
Thanks for BKREN ! It does the job beautifully.
Lefteous,
Thank you, I hadn't noticed the "replace" option in Multi-Rename! You always learn something nez with TC (I've been using it for many years),
But: something is not working well with the Multi-Rename. Files "loose" their names completely, and some files do not get renamed. I don't know why.
EitanG
Thanks for BKREN ! It does the job beautifully.
Lefteous,
Thank you, I hadn't noticed the "replace" option in Multi-Rename! You always learn something nez with TC (I've been using it for many years),
But: something is not working well with the Multi-Rename. Files "loose" their names completely, and some files do not get renamed. I don't know why.
EitanG
You can always preview how the names get changed. Maybe there were conflicting names?But: something is not working well with the Multi-Rename. Files "loose" their names completely, and some files do not get renamed. I don't know why.
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Additional there is the 'undo' function. It works even if you have closed the MRT after the last action. Simply reopen it, 'undo', and all filenames are rebuilt.Hacker wrote:You can always preview how the names get changed. Maybe there were conflicting names?But: something is not working well with the Multi-Rename. Files "loose" their names completely, and some files do not get renamed. I don't know why.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams