Created
May 22, 2019 06:35
-
-
Save arto-heino/7101084c39433ff5289f3bdea9c97a55 to your computer and use it in GitHub Desktop.
This file contains 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/env python | |
import os | |
# First get the folder name (SSN) and save it | |
folderlist = [name for name in os.listdir(".") if os.path.isdir(name)] | |
# Second get filelist on folder | |
def new_list(x): | |
for ssn in x: | |
for filename in os.listdir(ssn): | |
new_name = str(ssn) + '_' + str(filename) | |
# Third rename files to SSN_filenames | |
os.rename(os.listdir(i), new_name) | |
new_list(folderlist) | |
# Fourth move all files to raportit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment