By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,114 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,114 IT Pros & Developers. It's quick & easy.

how to modify the csv file

P: n/a
hi everybody
am trying to modify a particular string from a csv file.

for ex

say i have

compName, ipAddr, MacAddr, Os

sdfsdf , 129.122.12.34 , dsfiasdf, wsfdjhs
hsdfdf , 123.234.34.34, dsfiasdfds, wewr

etc

now if i got to modify one particular line from these three rows , how
can i do that.

thanks in advance
yogi

Dec 27 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

yogi> now if i got to modify one particular line from these three rows,
yogi> how can i do that.

Check out the csv module.

Skip
Dec 27 '05 #2

P: n/a
hi skip
i really tried with csv module, but i dint get anything, 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.

thanks
yogi

Dec 27 '05 #3

P: n/a
mu*******@yahoo.com wrote:
i really tried with csv module, but i dint get anything,
http://www.catb.org/~esr/faqs/smart-...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>

Dec 27 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.