Swip-Swapping Elements of File Name

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Alonzo Mosley
Junior Member
Junior Member
Posts: 61
Joined: 2018-03-28, 20:13 UTC

Swip-Swapping Elements of File Name

Post by *Alonzo Mosley »

I feel like I read how to do this somewhere, when I didn't need to know how to do this. And now that I do, I can't find it!

What I want to do, is take parts of what's at the end of a batch of file names, and put it at the beginning.

I have a bunch of files that were named
[Account Name] File Name.xlsx
And a bunch that were named
Account Name - File Name.xlsx
And more that were named
File Name (Account Name).xlsx

I'm pretty confident in my skills to clean up the first two. But how can I tell the system to tTake everything that 's in parentheses and move it to the front of the file name?

Does that make sense?

Thanks
Dan: You're gonna need to get someone to fix my computer.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Swip-Swapping Elements of File Name

Post by *Stefan2 »

How did you solve the first two?




 
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Swip-Swapping Elements of File Name

Post by *Usher »

Alonzo Mosley wrote: 2018-08-03, 21:47 UTCDoes that make sense?
If you want to rename files, you should do as follows:
1. Select all files with the same pattern, for example *(*).xls*. You can use F7 to find them on all partitions, or Ctrl+B to see all files in "Documents" subfolders.
2. For selected files use Multi-Rename Tool (Ctrl+M), possibly with regular expressions. I won't tell you the exact solution for your case, you should better learn how to do it on your own – it's really powerful tool and you will probably use it many times in the future.
Andrzej P. Wozniak
Polish subforum moderator
Alonzo Mosley
Junior Member
Junior Member
Posts: 61
Joined: 2018-03-28, 20:13 UTC

Re: Swip-Swapping Elements of File Name

Post by *Alonzo Mosley »

Yeah, see, I'm USING Multi-Rename, and can't make heads or tails of the documentation. I appreciate the "jump in, kid, and if you can swim out, cool, otherwise you'll be like your poor departed Uncle Fred" approach, but, um, I wouldn't ask for help if I didn't need... help.

Stefan - I wasn't totally clear. The desired output is "Account Name File Name", so I do know how to clean that up in MultiRename. It's the swip-swapping that I keep fouling up.


Light a man a fire, keep him warm for a night.
Light a man afire, keep him warm for a lifetime
I always say!
Dan: You're gonna need to get someone to fix my computer.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
User avatar
obeg
Junior Member
Junior Member
Posts: 43
Joined: 2006-09-28, 09:20 UTC
Location: Sweden

Re: Swip-Swapping Elements of File Name

Post by *obeg »

Then it is just to learn the wonderful world of Regex :-)

In search and replace, check the RegEx box and specify as follows.
Search for:
(.*) \((.*)\)

Replace with:
$2 - $1

If you want a fast summary, .* stands for many of any character ( and ) is used to group them (to be used in the reply). Then at last \( is the parenthesis to search for, but with an escape character, so it will not be confused with the groping characters.

The result the just takes the second matched () adds a dash and then the first match.

Br
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Swip-Swapping Elements of File Name

Post by *petermad »

2Alonzo Mosley
The desired output is "Account Name File Name"
Then you should replace with $2 $1 not with $2 - $1
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Alonzo Mosley
Junior Member
Junior Member
Posts: 61
Joined: 2018-03-28, 20:13 UTC

Re: Swip-Swapping Elements of File Name

Post by *Alonzo Mosley »

Think I have it, thanks. Still not totally understanding it, but... I don't have to understand Bernoulli's principle to catch a flight to O'Hare, either.

Thanks.

BTW: This made me laugh:
obeg wrote:Search for:
(.*) \((.*)\)
obeg wrote:...the groping characters
Dan: You're gonna need to get someone to fix my computer.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
User avatar
obeg
Junior Member
Junior Member
Posts: 43
Joined: 2006-09-28, 09:20 UTC
Location: Sweden

Re: Swip-Swapping Elements of File Name

Post by *obeg »

Alonzo Mosley wrote: BTW: This made me laugh:
obeg wrote:Search for:
(.*) \((.*)\)
obeg wrote:...the groping characters
Totally unintentional, but kind of funny now that I see it.
Guess I have to tweak the spellchecker before some gets offended...
Post Reply