| | |
read and write csv file using csv module
![]() |
•
•
Join Date: Oct 2007
Posts: 30
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Sep 2007
Posts: 33
Reputation:
Solved Threads: 8
This might help:
http://effbot.org/librarybook/csv.htm
http://effbot.org/librarybook/csv.htm
![]() |
Similar Threads
- Image read and write operations in turbo C (C)
- Read/write to same file > once, Help (C++)
- Random access read write (Visual Basic 4 / 5 / 6)
- Question about file read/write (Java)
- XP SP2 installation error: "unable to read from or write to the database" (Windows NT / 2000 / XP)
- Read and write to an ASCII Text file (Java)
Other Threads in the Python Forum
- Previous Thread: neebee: python static classes
- Next Thread: Limit size of a List
| Thread Tools | Search this Thread |
alarm ansi assignment avogadro backend beginner binary bluetooth character cipher cmd customdialog cx-freeze data decimals dictionary directory dynamic error exe file float format function generator getvalue gnu graphics halp heads homework http ideas import input ip itunes java keycontrol leftmouse line linux list lists loop maintain maze millimeter module mouse number numbers output parsing path pointer port prime programming progressbar push py2exe pygame python queue random recursion schedule screensaverloopinactive script scrolledtext slicenotation sqlite ssh statistics string strings sudokusolver sum text thread threading time tlapse tuple tutorial ubuntu unicode urllib urllib2 variable variables ventrilo vigenere web webservice wikipedia write wxpython xlib





