Skip to content

Commit 0e02174

Browse files
committed
updates
1 parent c121980 commit 0e02174

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ Based on the file path entered, renames all nested folders according to a CSV fi
2323
Based on the file path entered, renames files in the directory according to a specified CSV file with the columns named 'file' and 'newFile,' provided that there is a match between the files and the names in the 'file' column. The script writes a log of all files that were renamed, including their old name and their new name. The user will be prompted as to whether they want the file name changes executed or whether they just want log of the expected file name changes.
2424

2525
#### [samplingScript.py](/samplingScript.py)
26-
Based on the file path entered, selects every 10th file of a folder (after skipping the first file) and moves it over identically named folder in a 'sampled' directory while the skipped files are moved into an identically named folder in an 'unsampled' directory. The script also writes 'sampled' and 'unsampled' logs of all files that were moved, including their old location and their new location.
26+
Based on the file path entered, selects every 10th file of a folder (after skipping the first file) and moves it over identically named folder in a 'sampled' directory while the skipped files are moved into an identically named folder in an 'unsampled' directory. The script also writes 'sampled' log of all sampled files that were moved, including their old location and their new location.

samplingScript.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
f=csv.writer(open('sampledLog'+datetime.now().strftime('%Y-%m-%d %H.%M.%S')+'.csv','wb'))
1111
f.writerow(['oldLocation']+['newLocation'])
12-
f2=csv.writer(open('unsampledLog'+datetime.now().strftime('%Y-%m-%d %H.%M.%S')+'.csv','wb'))
13-
f2.writerow(['oldLocation']+['newLocation'])
1412

1513
for root, dirs, files in os.walk(filePath, topdown=True):
1614
print root
@@ -36,5 +34,4 @@
3634
root1 = root[:root.rfind('/')]
3735
root2 = root1[:root1.rfind('/')]
3836
newUnsampledLocation = os.path.join(root2, 'unsampled', project)
39-
f2.writerow([oldUnsampledLocation]+[newUnsampledLocation])
4037
shutil.move(oldUnsampledLocation, newUnsampledLocation)

0 commit comments

Comments
 (0)