Register
It is currently Thu Oct 23, 2014 2:40 am

Sorting (moving/copying) files depending on their name


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Thu Oct 24, 2013 10:59 am   

Joined: Thu Oct 24, 2013 10:43 am
Posts: 2
Hi

I have a folder with a lot of unsorted files (more particulary guitar tabulatures, a sort of sheet music for guitar);
"Dream Theater - Overture 1928 (E).gp5" (1)
"Dream Theater - Scarred (E).gp4" (2)
"Joe Satriani - Friends (Drop D).gpx" (3)
"Metallica - One (E).gpx" (4)
...

The files are all named on the format ARTIST - SONG (TUNING).gp*. I want to create a Bash script doing the following;

- Copy files (1), (2) and (4) to a folder named "E" (if this folder doesn't exist, I would like to create it).
- Copy file (3) to a folder named "Drop D" (if this folder doesn't exist, I would like to create it).
- Move files (1) and (2) to a folder named "Dream Theater" (if this folder doesn't exist, I would like to create it).
- Move file (3) to a folder named "Joe Satriani" (if this folder doesn't exist, I would like to create it).
- Move file (4) to a folder named "Metallica" (if this folder doesn't exist, I would like to create it).

How can I do this?


Top
 Profile  
 PostPosted: Thu Oct 24, 2013 6:56 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 550
hi,

Quote:
How can I do this?
like every body else: read the Advanced Bash Scripting guide.

then you write an algorithm, and the script.

if something doesn't work right, then we'll be glade to help.


Top
 Profile  
 PostPosted: Sat Oct 26, 2013 6:25 am   

Joined: Thu Oct 24, 2013 10:43 am
Posts: 2
Watael wrote:
hi,

Quote:
How can I do this?
like every body else: read the Advanced Bash Scripting guide.

then you write an algorithm, and the script.

if something doesn't work right, then we'll be glade to help.


Thank you so much


Top
 Profile  
 PostPosted: Sat Oct 26, 2013 7:07 am   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 550
you're welcome.

we can help people, we don't do their job, or homework.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP