Skip to content

Instantly share code, notes, and snippets.

@arto-heino
Created May 22, 2019 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arto-heino/f37bf64fae15cd0ff59e5adf7c071f50 to your computer and use it in GitHub Desktop.
Save arto-heino/f37bf64fae15cd0ff59e5adf7c071f50 to your computer and use it in GitHub Desktop.
#!/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):
a = {}
for i in x:
a[i] = {'old_name' : os.listdir(i)}, {'new_name' : os.listdir(i)}
return a
print(new_list(folderlist))
# Third rename files to SSN_filenames
# os.rename('a.txt', 'b.kml')
# Fourth move all files to raportit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment