Jump to content
Macro Express Forums
jamesd1

Is this possible? Multiple Directories from file names?

Recommended Posts

I want to have a macro that looks at all the files in a directory and then creates a new directory for each file (where the name of the directory is based on the file's name) and then moves each file in the original directory into the newly created directory.

 

So if E:\temp contains two files: filename1.mp4 and filename2.mp4 then the result would be two new directories containing one file each as in:

 

e:\Video downloads\filename1\filename1.mp4

e:\Video downloads\filename2\filename2.mp4

 

The newly created folders should not include the mp4 extrension

Share this post


Link to post
Share on other sites

I think this will work:

 

Repeat with Folder (folder E:\Temp, putting file name only into text variable T1)

Use Variable Modify Text commands to copy T1 to T2 and strip off the file extension from T2
Create Folder: "C:\%T2%"
Wait for Folder Exist: "C:\%T2%"
Copy File or Files: "E:\Temp\%T1%" (destination C:\%T2%\%T1%)
Repeat End

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...