By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,903 Members | 1,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,903 IT Pros & Developers. It's quick & easy.

Creating directory/subdirectory

P: 5
I have a file with below contents. the file is dynamically created with these values.It has two parts separated by _. Basically I need to create a main directory(a,b,c,d) first part and create the sub subdirectory(second part after _) into the respective directory. can you please give few tips to do the same.



a_1234
a_1234
b_12
a_1234
c_12
c_12345
d_12
Feb 1 '10 #1
Share this Question
Share on Google+
2 Replies


Expert Mod 100+
P: 589
Use File::Path - Create or remove directory trees
http://search.cpan.org/~dland/File-Path-2.08/Path.pm
Feb 1 '10 #2

P: 11
you will need to do a regex search to parse out the different parts of the file path, then add the directory is needed (use File::Path), and then move the file into the directory.
Feb 5 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.