-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfileMover.py
33 lines (29 loc) · 905 Bytes
/
fileMover.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from glob import glob
import os
import sys
from config import *
import shutil
fileList = glob(rawFilePath+'/*')
print(fileList)
def fileProccessor(fileList, mode = 'all'):
txtList = []
pdfList = []
if mode == 'all':
for files in fileList:
if files[-3:] == 'txt':
txtList.append(files)
shutil.move(files, txtFilesPath)
elif files[-3:] == 'pdf':
pdfList.append(files)
shutil.move(files, pdfFilesPath)
elif mode == 'txt':
for files in fileList:
if files[-3:] == 'txt':
txtList.append(files)
shutil.move(files, txtFilesPath)
elif mode == 'pdf':
for files in fileList:
if files[-3:] == 'pdf':
pdfList.append(files)
shutil.move(files, pdfFilesPath)
fileProccessor(fileList, mode= 'pdf')