Skip to content

Commit e02b62c

Browse files
added another script
1 parent c7674f5 commit e02b62c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

to-1dir-dataset.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
import csv
3+
4+
dataDir = input("Enter the directory to the data: ")
5+
metaDataDir = f"{ dataDir }/metadata.csv"
6+
7+
with open(metaDataDir, 'r') as f:
8+
r = csv.reader(f)
9+
for row in r:
10+
fileName, category, name, description = row
11+
txtDir = f"{ dataDir }/{ fileName[:fileName.find('.')] }.txt"
12+
with open(txtDir, 'w') as txt:
13+
txt.write(f"A { name } minecraft skin in the { category } category. { description }")
14+
os.remove(metaDataDir)

0 commit comments

Comments
 (0)