I have the following data from a csv file called temp.
Item,Description,Base Price,Available
2000-000-000-300,AC - CF/M Series Green For Black Hood,299.99,3
2000-000-000-380,AC - CF/M Series Green For White Hood,299.99,3
I need to change the headers to read
Item Number,Item Description,List Price,QTY Available
I have been searching similar questions on here and haven't a solution that I can understand since I am relatively new to python programming. So far I have:
import csv
import os
inputFileName = "temp.csv"
outputFileName = os.path.splitext(inputFileName)[0] + "_modified.csv"
with open(inputFileName) as inFile, open(outputFileName, "w") as outfile:
r = csv.reader(inFile)
w = csv.writer(outfile)
Which I know only reads the original file and then will write to _modified. How do I select the current headers and then change them so that they write to the new file?