make folders from files
#1
Ive done a quick search and found nothing. Anyone out there in mac land know of a way to go in a folder and make a folder for each file, name it the file name - the .ext, then move the said file into the new created folder. And do it numerous times until completed with the folder.

so pretty much this but something terminal would understand...sorry new to macs.


@echo on
for %%a in (*.*) do (
md "%%~na" 2>nul
move "%%a" "%%~na"
)
Reply
#2
schwallman Wrote:Ive done a quick search and found nothing. Anyone out there in mac land know of a way to go in a folder and make a folder for each file, name it the file name - the .ext, then move the said file into the new created folder. And do it numerous times until completed with the folder.

so pretty much this but something terminal would understand...sorry new to macs.


@echo on
for %%a in (*.*) do (
md "%%~na" 2>nul
move "%%a" "%%~na"
)

you do have bash at the command-line so you should be able to make a bash script to do this.
Reply
#3
Using the same windows command?
Reply
#4
schwallman Wrote:Using the same windows command?

http://en.wikipedia.org/wiki/Bash
Reply
#5
yeahhhhh, my head hurst from reading that
Reply
#6
i almost have it working in automator but no luck.
Reply
#7
python is the way to go Wink
Reply
#8
hello critit
do you have the script of automator and
if it yes can you send me
i a m beginner

thank you very much
Reply
#9
i know nothing about scripting on a mac or pc, but a friend at work made this for me to run on a pc, i would love to get it to work on my mac. i read the wiki about bash but just dont understand it. here it is for windows.

@echo on
for %%a in (*.*) do (
md "%%~na" 2>nul
move "%%a" "%%~na"
)
Reply

Logout Mark Read Team Forum Stats Members Help
make folders from files0