回答編集履歴
1
d
test
CHANGED
@@ -6,12 +6,32 @@
|
|
6
6
|
|
7
7
|
```python
|
8
8
|
|
9
|
+
import glob
|
10
|
+
|
9
|
-
|
11
|
+
import openpyxl
|
10
12
|
|
11
13
|
|
12
14
|
|
13
|
-
|
15
|
+
files = glob.glob(r"C:\Users\test\*.xlsx")
|
14
16
|
|
17
|
+
|
18
|
+
|
19
|
+
f = open("output.txt", "w")
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
for file in files:
|
24
|
+
|
25
|
+
wb = openpyxl.load_workbook(file)
|
26
|
+
|
27
|
+
A = wb["Sheet2"]["G47"].value
|
28
|
+
|
29
|
+
B = wb["Sheet2"]["C47"].value
|
30
|
+
|
31
|
+
C = wb["Sheet2"]["A49"].value
|
32
|
+
|
33
|
+
|
34
|
+
|
15
|
-
f.write(f"{A},{B},{C}\n") #
|
35
|
+
f.write(f"{A},{B},{C}\n") # 1行に A,B,C と書き込む場合
|
16
36
|
|
17
37
|
```
|