Search code examples
pythonpcap

how to extract the pcap time field using python and I need to find the time difference between 2 frames


I am trying to extract the time field from the PCAP file using the python and I need to find the time difference between 2 frames in the PCAP file thank you!


Solution

  • import os import csv os.chdir('C:\Program Files\Wireshark') os.system( " tshark -r C:\Users\shalini.r\OneDrive\Desktop\tick.pcap -T fields -E header=y -E separator=, -E quote=d -E occurrence=f -e frame.time_delta -e udp.dstport -E header=n > C:\Users\shalini.r\Documents\check1.csv")

    with open('C:\Users\shalini.r\Documents\check1.csv', 'r') as file: reader = csv.reader(file)