Feb-24-2019, 01:13 AM
Hi, I would like to ask on how we can write these set of list which has list in it?
Target output on csv is like this(attached).
Thanks
Target output on csv is like this(attached).
opo = ['device1', 'device1', 'device1'] intfname = [['HundredGigE0/2/0/0', 'HundredGigE0/2/0/0.242', 'HundredGigE0/2/0/0.244 l2transport', 'HundredGigE0/2/0/1', 'HundredGigE0/2/0/0.244'], ['TenGigabitEthernet1/1/0.138'], ['TenGigE0/1/0/15']] descname = ['0/2/0/0info1', '0/2/0/0.242info2', '0/2/0/0.244info3'] ## EXPORT AS CSV with open('intlist.csv', 'w', newline='') as updatecsv: write = csv.writer(updatecsv, delimiter=',',lineterminator='\n') write.writerows(zip(opo,intfname,descname)) updatecsv.close() print ("Done...")my current out is like:
Column1 C2 C3 device1 [int1,int2,int3] [desc1, desc2, desc3] device2 [int1,int2] [desc1, desc2]what method should I use to achieve this?
Thanks