Answers for "replace value in a csv file using python"

2

how to replace a word in csv file using python

import csv

inputfile = csv.reader(open('civil-war-battles.csv','r'))
outputfile = open('placelist.txt','w')

i=0

for row in inputfile:
    place = row[2].replace(' ,',',')
    print place
    outputfile.write(place+'n')
    i+=1
Posted by: Guest on June-04-2020

Code answers related to "replace value in a csv file using python"

Python Answers by Framework

Browse Popular Code Answers by Language