I have a file that contains flow statistics from a switch. This is a big file with alot of values I would like to print out the statistics based on user input.
I'm having a hard time to figure out which way is the most efficient, using a dictionary or a list. I'm looking for a way to split my keys and values
element ={"cookie": " ","duration": " ","table": " ","n_packets": " ","n_bytes": " ",
"idle_timeout": " ","idle_age": " ","priority": " ","arp": " ","in_port": " ","vlan_tci": " ","dl_src": " ","dl_dst": " ","arp_spat": " ",",arp_tpa": " ",",arp_op": " ",",actions": " ",}
c=[] #cookie list
dur =[] #duration list
with open("flow.txt") as f: #opening file
for line in f: #loop the file
line.split("=")
print(line)
if "cookie" in line: #if this cookie exsist in file append its value into c
print
if "duration" in line: #if this duration exsist in file append its value into c
print