CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Move files based on filename

 



tigger29900
New User

Jan 4, 2012, 1:45 PM

Post #1 of 2 (504 views)
Move files based on filename Can't Post

I was looking to move a group of files in a folder based on their file names. I have a bunch of files that need to be moved to specific folders each month that all get grouped in a download folder. I was looking for a perl script that would take them out of the download folder and move them into their designated group folders automatically ie 3 files go to one folder 5 to a different folder and so on. Any help would be appreciated thanks


BillKSmith
Veteran

Jan 5, 2012, 12:39 PM

Post #2 of 2 (492 views)
Re: [tigger29900] Move files based on filename [In reply to] Can't Post

use the function glob (Refer: perldoc -f glob) to read the download directory. Use regular expressions to identify the type of file. Use the move function of the module File::Copy to move the files.
Good Luck,
Bill

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives