What is the best way to do this?: Create folder from file name and move file

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
DjobyDjoba
Junior Member
Junior Member
Posts: 52
Joined: 2006-10-23, 09:46 UTC

What is the best way to do this?: Create folder from file name and move file

Post by *DjobyDjoba »

Hi,

What is the best / fastest way to do this?

1) Select a bunch of files (all are located in the same folder)
2) For each selected file, create, in the destination panel, a folder named as the file (but without the extension)
3) Move each file to its folder (the one create in step 2 with the same name)

Thanks!
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: What is the best way to do this?: Create folder from file name and move file

Post by *Gral »

1. Select all files.
2. Run Multi-rename tool - Files - Multi-Rename Tool (CTRL+M)
3. Type

Code: Select all

[N]\[N]
in "Rename mask: file name" field.
4. Press "Start"

EDIT: Sorry i didn't notice earlier "in the destination panel" but this require only one additional step: move all to destination folder.
NotNull
Senior Member
Senior Member
Posts: 269
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: What is the best way to do this?: Create folder from file name and move file

Post by *NotNull »

Don't know if it is the best way, but it is rather straightforward:
  • Select your files
  • Menu:Files > Multi-Rename Tool...
  • Configure Rename mask: file name =

    Code: Select all

    [N]\[N]
  • Check if Extension =

    Code: Select all

    [E]
  • Press the Start button.
  • Press the Close button.
  • Done
The folders will be created if they don't exist.
DjobyDjoba
Junior Member
Junior Member
Posts: 52
Joined: 2006-10-23, 09:46 UTC

Re: What is the best way to do this?: Create folder from file name and move file

Post by *DjobyDjoba »

Great! I didn't realize MRT could move files too! Such a powerful command!

For my knowledge, now admit that instead of moving files we want to copy files? Can we use the MRT too, and if not, what would be the way?
NotNull
Senior Member
Senior Member
Posts: 269
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: What is the best way to do this?: Create folder from file name and move file

Post by *NotNull »

2Gral:

Double-post! (I didn't see your message when writing mine). Luckily it was the exact same solution :)
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: What is the best way to do this?: Create folder from file name and move file

Post by *nsp »

DjobyDjoba wrote: 2020-07-02, 04:51 UTC Great! I didn't realize MRT could move files too! Such a powerful command!
As said by gral, be aware that you cannot directly use MRT to move to another location. What can be done is to use a "fake working target" folder and then move and delete the temporary folder..
in name you can add $TARGET$\[N]\[N]
you will have all ready to move inside $TARGET$ folder under original location...


Using TCBL, you can do it as you want creating a batch script i.e

Code: Select all

command: <path to>\tcbl.exe
parameters: -q %L md """%T$z""" $;  move """$f""" """%T$z\$n"""
Post Reply