how to modify the csv file

Fredrik Lundh fredrik at pythonware.com
Tue Dec 27 17:42:12 EST 2005


muttu2244 at yahoo.com wrote:

> i really tried with csv module, but i dint get anything,

http://www.catb.org/~esr/faqs/smart-questions.html#beprecise

> could u plase tell me the method to modify a particular row, or
> atleast let me know how can i delete a row in a csv file.

the same way as you'd modify or delete a row in any other text
file: by reading the entire file, modifying the data, and writing it
out again.

you can either do this line by line (reading from one file and writing
to another, modifying the data on the way), or in "bulk" (load every-
thing into memory, modify the data structure, and write it out again).

</F>






More information about the Python-list mailing list