query on csv file reading and replacing

M

muttu2244

Hi everybody

Am trying to read a csv file "temp.csv", which has the below info,


compName macAddr ipAddr
opSys

Chris-Dev 0003469F44CC 10.160.24.226 Microsoft Windows XP
Professional
Shivayogi-Dev 000D5234F44C 10.160.24.136 Microsoft Windows XP
Professional
John-test 000D123F44CC 10.160.24.216 Microsoft Windows XP
Professional Steve-Dev 000D123F55CC 10.160.24.116 Microsoft
Windows XP Professional

am trying to read it in the following way--
.... if row[0] == infnList[0]:
.... if not row[1] == infnList[1] or not row[2] == infnList[2]:

now am comparing my comp Name with the "compName" fields, and if it
matches i ll then compare for the "mac address" and "ip address". if
they are not matching with my system, i have to modify them there
itself, i mean i have to update "mac address" and "ip address" in the
same row itself, i dont want to append the information with another row
to the "temp.csv" file. otherwise it will have two similar computer
names for two rows, which i dont want to happen.

please give me the ways how i can work on this.

thanks in advance
yogi
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top