read and write csv file using csv module

Discussion in 'Python' started by jliu66, Oct 19, 2007.

  1. jliu66

    jliu66

    Joined:
    Oct 19, 2007
    Messages:
    3
    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, Oct 19, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tintin92
    Replies:
    1
    Views:
    1,750
    Andrew Thompson
    Feb 14, 2007
  2. Chris
    Replies:
    3
    Views:
    251
    Steven D'Aprano
    Sep 11, 2007
  3. Li Chen
    Replies:
    18
    Views:
    686
    Azmi Farih
    Mar 23, 2010
  4. Ram
    Replies:
    3
    Views:
    260
    Tad McClellan
    Apr 26, 2007
  5. Sacha Rook

    csv read clean up and write out to csv

    Sacha Rook, Nov 2, 2012, in forum: Python
    Replies:
    2
    Views:
    230
    Hans Mulder
    Nov 2, 2012
Loading...

Share This Page