回答編集履歴
2
方法
test
CHANGED
@@ -11,3 +11,31 @@
|
|
11
11
|
f.write("%s\n" % i)
|
12
12
|
|
13
13
|
```
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
ーーー更新ーーー
|
18
|
+
|
19
|
+
Stack OverFlowで次の方法を見つけました
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
https://stackoverflow.com/questions/47339698/how-to-convert-csv-file-to-text-file-using-python
|
24
|
+
|
25
|
+
```python
|
26
|
+
|
27
|
+
import csv
|
28
|
+
|
29
|
+
csv_file = raw_input('Enter the name of your input file: ')
|
30
|
+
|
31
|
+
txt_file = raw_input('Enter the name of your output file: ')
|
32
|
+
|
33
|
+
with open(txt_file, "w") as my_output_file:
|
34
|
+
|
35
|
+
with open(csv_file, "r") as my_input_file:
|
36
|
+
|
37
|
+
[ my_output_file.write(" ".join(row)+'\n') for row in csv.reader(my_input_file)]
|
38
|
+
|
39
|
+
my_output_file.close()
|
40
|
+
|
41
|
+
```
|
1
誤字
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
csvの列数は幾つがありますか?一
|
1
|
+
csvの列数は幾つがありますか?一列なら,下のコードで行けると思います.
|
2
2
|
|
3
3
|
|
4
4
|
|