[Tutor] Adding Value to CSV

Paras K. paras80 at gmail.com
Sat Oct 31 19:23:42 CET 2009


I have some code that is going through a number of test.

When I have the line that has been read I need to add another value at the
end of it, or write the information into another csv file

Example of my code:

for line in fh.readlines():
            readline = line
            ipline = readline
            ip = ipline.split(' ')[0]
            split_ip = ip.split('.')
            if ((split_ip[0] == '"152')):
                ff.write(readline)
                totalcount +=1


I need to add another piece, how can I add another field at the end of
ff.write(readline)


Any assistance would be greatly appreciated. Thank You.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091031/48f3290d/attachment.htm>


More information about the Tutor mailing list