Last active
June 14, 2019 15:41
-
-
Save clubgisdotnet/6fe5fe04c5091bea3dbbb9fd36b7dc52 to your computer and use it in GitHub Desktop.
Wrap each files with a folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # !/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # Wrap each files to its own folder, run once | |
| import os | |
| import shutil | |
| dir_name = "D:\\DOCUMENTS\\Google_Link\\all docx" | |
| docx_files = os.listdir(dir_name) | |
| for i in docx_files: | |
| os.mkdir(os.path.join(dir_name , i.split(".")[0])) | |
| shutil.move(os.path.join(dir_name , i), os.path.join(dir_name , i.split(".")[0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment