Created
February 11, 2021 13:00
-
-
Save kotoripiyopiyo/c0847b706ecd6e510f77ed18c91c9a03 to your computer and use it in GitHub Desktop.
1文字ずつ書き込まれる謎
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
input_file = open('example.csv') | |
output_file = open('copycsv.csv', 'w', newline='') | |
input_reader = csv.reader(input_file) | |
output_writer = csv.writer(output_file) | |
for i in input_reader: | |
output_writer.writerow(i) | |
output_writer.writerow(str(i)) | |
output_file.close() | |
input_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example.csv中身:
4/5/2014 13:34,Apples,73
4/5/2014 3:41,Cherries,85
4/6/2014 12:46,Pears,14
4/8/2014 8:59,Oranges,52
4/10/2014 2:07,Apples,152
4/10/2014 18:10,Bananas,23
4/10/2014 2:40,Strawberries,98
copycsv.csv中身:
4/5/2014 13:34,Apples,73
[,',4,/,5,/,2,0,1,4, ,1,3,:,3,4,',",", ,',A,p,p,l,e,s,',",", ,',7,3,',]
4/5/2014 3:41,Cherries,85
[,',4,/,5,/,2,0,1,4, ,3,:,4,1,',",", ,',C,h,e,r,r,i,e,s,',",", ,',8,5,',]
4/6/2014 12:46,Pears,14
[,',4,/,6,/,2,0,1,4, ,1,2,:,4,6,',",", ,',P,e,a,r,s,',",", ,',1,4,',]
4/8/2014 8:59,Oranges,52
[,',4,/,8,/,2,0,1,4, ,8,:,5,9,',",", ,',O,r,a,n,g,e,s,',",", ,',5,2,',]
4/10/2014 2:07,Apples,152
[,',4,/,1,0,/,2,0,1,4, ,2,:,0,7,',",", ,',A,p,p,l,e,s,',",", ,',1,5,2,',]
4/10/2014 18:10,Bananas,23
[,',4,/,1,0,/,2,0,1,4, ,1,8,:,1,0,',",", ,',B,a,n,a,n,a,s,',",", ,',2,3,',]
4/10/2014 2:40,Strawberries,98
[,',4,/,1,0,/,2,0,1,4, ,2,:,4,0,',",", ,',S,t,r,a,w,b,e,r,r,i,e,s,',",", ,',9,8,',]
なぜこうなるのか‥理由不明