I am trying to pull words and integers from a text file and have them all print on the same line using if statements. Would I need to continue with the for loop to achieve the outputs to be printed on the same line?
I am trying to get it print frame #, type:0x0800
with open('wireShark.txt', 'rt') as file_content:
for line in file_content:
if 'Frame' in line:
i=line.find(':')
idnum = line[0:i]
print(idnum)
if 'Type' in line:
i=line.find(':')
idnum4 = line[4:9]
print (idnum4)
if '0x0800' in line:
i=line.find(')')
idnum5 = line[16:i]
print (idnum5)