Read from a .csv file containing exported pcap packet info using Tshark and count particular instances in Python
Question: I want to read from a .csv file(created from a .pcap file) and count the no.
of instances for certain network packets in python under info column in
python. I am using python 2.7 on Windows 7 OS.Is there a way I can do this.

Thanks in advance


Answer: Try this <https://docs.python.org/2/library/csv.html>

    
    
    >>> import csv
    >>> with open('eggs.csv', 'rb') as csvfile:
    ...     spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
    ...     for row in spamreader:
    ...         print ', '.join(row)
    

