Answer the question
In order to leave comments, you need to log in
How to correctly copy text from one csv file to another?
The essence of the problem: my code (presented below) copies the columns from one "ishod" file to the "answer" file. All of them have ".csv" extension. But the problem is that they all end up in 2 columns and huge rows, even though the original file has many columns, not two. That is to say, the code for some reason turns the pillars over and turns them into rows. How to fix it?
file = open("ishod.csv","rb")
my_file = open("otvet.csv", "w+")
line_count = 0
for line in file:
if line != "\n":
print(line)
my_file.write(str(line))
line_count += 1
ishod.close()
otvet.close()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question