0

Trying to store the header row of csv file, i.e. it's first row in a list after reading the file using reader(). Tried using next() and filednames() but none worked. Could anyone guide me how to achieve this?

Thanks to anyone who gives their time.

1

header = next(<reader variable>)

The next function should give you the 1st row of the file, but I am unsure if this is the answer to your situation as you did not provide any code.

| improve this answer | |
  • That worked out, thank you!! – Ayush Apr 25 at 19:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .