I have list of string from which i want to extract channel number value with low SIG value. Below is mt list name "Outlines"
Flags: A - active, P - privacy, R - routeros-network, N - nstreme, T - tdma,
W - wds, B - bridge
ADDRESS SSID CHANNEL SIG NF SNR RADIO-... ROUTER...
AP 20:B5:C6:F1:B6:B0 INAPHDBD... 5815/2... -78 -60 -18
52:4F:54:43:4F:44 P2MPRWXX... 5835/20/a -80 -102 22
A 52:41:44:57:49:4E 5835/20/a -86 -102 16
APR B 4C:5E:0C:BF:EE:6E iBw 5865/2... -75 -102 27 4C5E0C... 6.38.5
A 00:19:70:2C:FD:82 TR6SL5 5835/20/a -86 -102 16
20:B5:C6:F0:E6:F7 5855/20/a -58 -103 45
Below is the code i tried, but didnt know how i can iterate when line starts without blank or any other random value.
RSSI = ''
Myindex = [l for l, elem in enumerate (outlines) if 'AP' in elem]
#Myindex = [elem for elem in outlines if 'AP' in elem]
#RSSI =int('nan')
for ind in Myindex:
newchannel = " ".join(outlines[ind].split()).split(' ')[3]
newRSSI = " ".join(outlines[ind].split()).split(' ')[4]
if RSSI < newRSSI or RSSI == '':
RSSI =newRSSI
channel = newchannel.split('/')[0]
print(channel)
s[n:m]syntax digitalocean.com/community/tutorials/…