Previously I was working on reading the MACs and formatting the output. I'm trying to do it using Pandas and Excel file now with the macaddress module. I'm pretty close but hitting a snag at the end.
def readfile_excel():
df = pd.read_excel('ap_macs.xlsx', usecols=['apmac'], index_col=False)
df_csv = pd.DataFrame.to_string(df,index=0,header=None)
df_split = df_csv.splitlines()
#print(df_split)
for i in df_split:
data = (i)
print(data)
mac_data = macaddress.MAC(data)
print(mac_data)
Getting the following error:
ValueError: ' D0D3E0C19A54' cannot be parsed as MAC
So it looks like when I split the lines, ' ' this extra stuff in there is not going away
[' D0D3E0C19A54', ' D0D3E0C19A55', ' D0D3E0C19A56']
Even though if I print out the "data" it doesn't show up there. Any tips/pointers? Thank you