You are not logged in.

#1 2005-11-01 17:37:09

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

move a transcoded file back to original location?

looking for a little help here..

am transcoding mp3 to oggs in multiple directories, this is easy enough manually but need to add it to a script.I have it finding all files and changing them but it leaves them, in the parent directory.Any ideas on how to insert them back into the original folders?

whatt i am doing so far is this..
find Songs -name '*.mp3' -exec mp32ogg *.mp3 {} ;
then a simular line to remove them...
find Songs -name '*.mp3' -exec rm  {} ;
I need this to be automated so that there is no user interaction

Offline

#2 2005-11-01 20:11:03

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: move a transcoded file back to original location?

If it's a simple directory tree like this:

Songs-|-dir1
      |-dir2
      |-dir3
      |-dir4 

I would do something like this:

for dir in $(ls);do
  cd $dir
  mp32ogg *.mp3
  rm *.mp3
  cd ..
done

I'm still learning bash so the above code might not work. I'm not sure about the $(ls) stuff.  The idea is to cd into each directory, convert the ogg file then cd back in parent directory.

Offline

#3 2005-11-01 20:47:29

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

Re: move a transcoded file back to original location?

Thanks snowman, have tried that, turn out the answer was under my nose mp32og was written with this task in mind... DOH smile

mp32ogg  --delete 'dirname' 'dirname'


sometimes we make work for ourselves...

Offline

Board footer

Powered by FluxBB