[I am expecting the output as shown in the left side, i am getting the output as shown in the right side]
1I have a list:
listA = ['Vlan VN-Segment', '==== ==========', '800 30800', '801 30801', '3951 33951']
My output should be
vlan vn-segment
==== ==========
800 30800
801 30801
3951 33951
But all the 4 rows show be in a single CELL in Excel. as above
I tried the following, but the output will be in 4 different rows in the Excel/cvs
my_input_file = open('n9k-1.txt')
my_string = my_input_file.read().strip()
my_list = json.loads(my_string)
#print(type(my_list))
x = (my_list[2])
print(x)
t = StringIO('\n'.join(map(str, x)))
df = pd.read_csv(t)
df2 = df.to_csv('/Users/masam/Python-Scripts/new.csv', index=False)