You are not logged in.
Pages: 1
Is there a pascal script that I can use, please, to reverse the names of my huge collection of folders?
For example, I have a folder called John Smith (no comma, just one space between words) and I want to rename it to Smith, John (with a comma then one space between words.
I'm not experienced enough to write a script so I'm holing someone kind will do it!
Thanks
Offline
Hi and welcome.
FROM:
John Smith
TO:
Smith, John
Use for example the Rearrange Rule
https://www.den4b.com/wiki/ReNamer:Rules:Rearrange
(there are Examples at the end of that page)
For your issue use
Split by delimiters " " (((That will split at an space and store the parts into $1,$2,...)))
New pattern "$2, $1" (((Rearrange the matched parts and add an comma yourself)))
[x]skip extension
Note: Quote-signs are only for clarification, don't use them in the rule itself!
In the ReNamer sub-forum there are more posts about that, just search for "swap" for more ideas.
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
Thanks for that helpful reply. I have also read the forum you suggest; sadly neither are working for me.
I have a huge number of ebooks stored in folders such as "Stephen King" (without the quotes") and want to rename the to "King, Stephen" (without the quotes). I've tried your solution and also
Example 4:
Task: Switch the words, and remove the comma between them.
From: To:
King, Stephen Stephen King
Cook, Robin Robin Cook
Settings:
Delimiter: ", " (without the quotes)
New Order: $2 $1
Obviously that's the opposite of what I want but the rule should be clear.
Applying that rule and your suggestion to "Stephen King.epub"
What I get is ", Stephen King.epub"
I've tried various arrangements - but I'm obviously missing something. What?
Also, this applies to files - where is the setting to apply it to folder names only (and not folder contents)?
Thank you!
Offline
I've tried various arrangements - but I'm obviously missing something. What?
Hi, sorry, I am not sure if I understand you correctly (my bad due my bad english)
But I provided you already the solution for your renaming issue in my post above. You say that that didn't work?
Also, this applies to files - where is the setting to apply it to folder names only (and not folder contents)?
See menu Settings > Filters
The documentation is there > https://www.den4b.com/wiki/ReNamer:Filter_settings
That?
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
Try these?
- - - -
Example 1- rearrange with no comma
Single Rule- Rearrange
tick "Exact pattern of Delimeters" at top
"| |" (no quotes)
New Pattern
$2 $1
skip ext.
Example 2- rearrange with added comma
Single Rule- Rearrange
tick "Exact pattern of Delimeters" at top
"| |" (no quotes)
New Pattern
$2, $1
skip ext.
Example 3- rearrange with comma removed
Rule #1
Replace
Replace:
", " (no quotes)
With:
" " (no quotes)
Rule #2
Rearrange
tick "Exact pattern of Delimeters" at top
"| |" (no quotes)
New Pattern
$2 $1
skip ext.
Last edited by Rnmr (2020-05-20 01:47)
To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.
- RWE
Offline
Question 1: How to rearrange "John Smith" to "Smith, John".
You can use the Rearrange rule or the Regular Expressions rule. There are many examples on the forum and on the wiki.
Using the Rearrange rule:
* Exact pattern of delimiters: " " (just a space character, without quotes)
* New pattern: $2, $1
Question 2: How to rename folders, rather than files.
Adjust your Filter Settings.
Enable "Add folders as files" option and disable "Add files within folders" option, and check other filter settings.
Offline
Yes, you only need a space to represent the space division in this particular example.
I'm just in the habit of using pipes for spaces because they
make the spaces easier to visualize in that field and will work for
any number of words, not just the simple 2 word split.
Last edited by Rnmr (2020-05-20 16:54)
To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.
- RWE
Offline
I have to say that I'm really impressed and so grateful for all of the swift and helpful advice on this forum. Quite rare and outstanding.
No idea why Stefan's solution wouldn't work (thanks Stefan) but this works a treat:
Example 2- rearrange with added comma
Single Rule- Rearrange
tick "Exact pattern of Delimeters" at top
"| |" (no quotes)
New Pattern
$2, $1
skip ext.
Thank you Rnmr!
I will now convert thousands of folders (I have a huge collection) in a matter of minutes.
This is a great program with multiple uses. Now that I've found it, it's certainly a keeper.
Offline
Pages: 1