1

I want to remove the header from my csv writer (the output file). Not sure what to do. Below is my code:

def WriteToCSV(OutPutFile, dataOut):
    global logger

    try:
        with open(OutPutFile, 'w', newline='') as csvfile:
            writer = csv.writer(csvfile, delimiter='|', quotechar='"', quoting=csv.QUOTE_ALL)

            for data in dataOut :
                writer.writerow(data)
eyllanesc
  • 235,170
  • 19
  • 170
  • 241

1 Answers1

0

You're passing in a list of output data. The 1st element is the CSV column headings. Simply elide it:

            for data in dataOut[1:]:
J_H
  • 17,926
  • 4
  • 24
  • 44