Question: Python help: I have a bunch of files, inside each file is a date (2012/03/22) I need to write a code that creates a directory

Python help: I have a bunch of files, inside each file is a date (2012/03/22) I need to write a code that creates a directory for the year-month, and day in the file. and then moves the files into the proper folder. so the end result would be inside the 2012 folder, inside the 03 folders, inside the 22 folders. is the file that contains 2012/03/22.

all while only using the os. module to list the dirs, move files, join paths etc

all of this should be done through functions and only using functions. also while making it portable to other computers. i have done this by making a basepath function to be stored as a variable with the base path being c:/user/username/python files/data to sort

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!