GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Need and OS X Script to create folders from files. (https://gfy.com/showthread.php?t=1050357)

Gerco 12-18-2011 02:51 PM

Need and OS X Script to create folders from files.
 
Have thousands of videos in a folder. I need a script for OSX that can create a folder based on the files name, then put that file into a subdirectory of that created folder. The subdirectory would always have the same name, IE "source_video"

Example,

file named dirtyxyx.mov would create dirtyxyz>source_video>dirtyxyz.mov

This is so I can easily create the hierarchy I need for ElevatedX.

Thanks for any help.

mrgica 12-18-2011 02:58 PM

As a webmaster for over 10 years, doing repeating skit in folders and files over and over while building a site, I always hoped next windows version would be smarter and recognize repeating actions and ask me if I would allow it to do the job for me :)
40,000 MHz and still stupid as a cockroach.

raymor 12-18-2011 02:59 PM

for file in *.mov
do
dir=`echo "$file" | sed '[email protected]$@@'`
mkdir -p "$dir/source_video/"
mv "$file" "$dir/source_video/"
done

The above written on my Android phone and untested.

CurrentlySober 12-18-2011 02:59 PM

you use a mac, so you are a gay de bum boy!

borked 12-18-2011 04:00 PM

Strange - why would elevatedX require such strict naming nomenclature?
Sorry, I'm not an eX user, but curious as to why they would force you to rename stuff like that to be able to import?

Surely the prog could figure out whether the file was a movie or pic, and create folders accordingly....

facialfreak 12-18-2011 04:41 PM

Your running elevatedX on a MAC server :eek2

fris 12-18-2011 04:43 PM

anything that works with bash scripting should work on osx

Gerco 12-18-2011 04:45 PM

Quote:

Originally Posted by facialfreak (Post 18638518)
Your running elevatedX on a MAC server :eek2

lol...no... My home systems are all macs. I'm doing organization and encoding local then uploading to the server (Mojohost) No sense uploading a master and having the server encode it when I can do the same here faster.

Gerco 12-18-2011 04:46 PM

Quote:

Originally Posted by borked (Post 18638466)
Strange - why would elevatedX require such strict naming nomenclature?
Sorry, I'm not an eX user, but curious as to why they would force you to rename stuff like that to be able to import?

Surely the prog could figure out whether the file was a movie or pic, and create folders accordingly....

Every CMS I have ever had requires their own form of a naming convention to upload. Nothing new. Sure, it would be amazing to be able to just upload a folder of video and have the system chunk it and sort it, but it doesn't work that way.


All times are GMT -7. The time now is 06:14 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123