-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFile mover.py
More file actions
24 lines (17 loc) · 746 Bytes
/
File mover.py
File metadata and controls
24 lines (17 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
File mover.py is a python script which is used to move the files from one location to another.
The name of files that are to be moved from one location to another is specified in a text
file called 'Unsupported Files.txt' and the files that are meant to be moved are unsupported
pdf files from the yesterday's work.
The program should be executed once only after the successful execution as it will give error
if the files and folders already exists or are moved to the location.
"""
import os
import shutil
fileobj = open('Unsupported Files.txt','r')
contents = fileobj.read()
contentlist = contents.split('\n')
os.chdir('H:\\backup\\pdf')
for file in contentlist:
shutil.move(file,'H:\\backup\\Unsupported pdf\\')
fileobj.close()