Skip to content

Commit c121980

Browse files
committed
change from csv to txt
1 parent 32f5f60 commit c121980

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ $RECYCLE.BIN/
4545
Network Trash Folder
4646
Temporary Items
4747
.apdisk
48-
*.csv
48+
*.csv
49+
*.md5

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Based on the file path entered and file extension specified, extracts the names
1414
Based on the file path entered, extracts the names of all nested folders and writes them to a CSV file.
1515

1616
#### [generateChecksumsForFilesInDirectory.py](/generateChecksumsForFilesInDirectory.py)
17-
Based on the file path entered, creates a CSV of all files in that directory and the files' MD5 checksums.
17+
Based on the file path entered, creates a checksum.md5 file containing the names of all files in that directory and the files' MD5 checksums.
1818

1919
#### [renameDirectories.py](/renameDirectories.py)
2020
Based on the file path entered, renames all nested folders according to a CSV file named 'FolderNames.csv' with the columns named 'oldFolder' and 'newFolder,' provided that there is a match between the nested folders and the names in the 'oldFolder' column. The script writes a log of all folders that were renamed, including their old name and their new name.

generateChecksumsForFilesInDirectory.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import hashlib
2-
import csv
32
import argparse
43
import os
54

@@ -17,12 +16,11 @@
1716
for file in files:
1817
fileList.append(os.path.join(root, file).replace('\\','/'))
1918

20-
f=csv.writer(open('fileChecksums.csv', 'wb'))
21-
f.writerow(['fileName']+['checksum'])
19+
f = open('checksum.md5','wb')
2220

2321
for file in fileList:
2422
fileName = file[file.rindex('/')+1:]
2523
print fileName
2624
file = open(file,'rb').read()
2725
checksum = hashlib.md5(file).hexdigest()
28-
f.writerow([fileName]+[checksum])
26+
f.write(checksum+' '+fileName+'\n')

0 commit comments

Comments
 (0)