-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbigtagplotter.py
More file actions
51 lines (41 loc) · 1.35 KB
/
bigtagplotter.py
File metadata and controls
51 lines (41 loc) · 1.35 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import os
from openpyxl import Workbook
from openpyxl.compat import range
from openpyxl.utils import get_column_letter
wb = Workbook()
wbOld = load_workbook(filename = "C:/Users/Ext.Ajames/Downloads/Copy of FLE GZ- Bonding Parameter Database v1.3 2018 07 011.xlsx"
dest_filename = 'empty_book.xlsx'
i = 1
ws = wb.active
rootDir = "//USFL-S-fP01/productiontesters$/SWT/Products/G3/Production"
csvList = list()
pngList = list()
rcpList = list()
for dirName, subdirList, fileList in os.walk(rootDir):
#print('Found directory: %s' % dirName)
for fname in fileList:
#print('\t%s' % fname)
if fname.endswith(".sup"):
csvList.append(fname)
if fname.endswith(".png"):
pngList.append(fname)
if fname.endswith(".rcp"):
rcpList.append(fname)
print(fname)
for tags in csvList:
x = tags.find("_")
if(x > 0):
ws["A" + str(i)] = tags[:(x)]
ws["B" + str(i)] = tags
for png in pngList:
if png[:-4] == tags[:x]:
ws['C' + str(i)] = png
print("FoundPNG!!")
png.splitlines
for rcp in rcpList:
if rcp[:-4] == tags[:x]:
ws['D' + str(i)] = rcp
print(i)
i = i + 1
print("Done!")
wb.save("newboy2.xlsx")