954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

read and write csv file using csv module

Hi, my friends,

I am new to python. I am trying to user csv module to read and write the data in csv. Here is data format. # of columns in each row are the same. 1st row is a header. how I can pass the data into 2-D array? Can you show a sampel code to read and write from a csv file please? Thanks so much in advance.

Equity #,No,Date,Long,Entry,Name1,Currency,Country
1,1,35860,AEP,48.38,AMERICAN ELECTRIC POWER,USD,USA
2,2,38412,AEP,33.71,AMERICAN ELECTRIC POWER,USD,USA
4,1,35094,CMS,31,CMS ENERGY CORP,USD,USA
4,2,35135,CMS,29.13,CMS ENERGY CORP,USD,USA


John

jliu66
Light Poster
30 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 
paddy3118
Light Poster
35 posts since Sep 2007
Reputation Points: 21
Solved Threads: 11
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You