簡體   English   中英

使用Tshark從包含導出的pcap數據包信息的.csv文件中讀取數據,並計算Python中的特定實例

[英]Read from a .csv file containing exported pcap packet info using Tshark and count particular instances in Python

我想從.csv文件(從.pcap文件創建)中讀取內容,並計數為否。 python的info列下的python中某些網絡數據包的實例數。 我在Windows 7 OS上使用python 2.7,有沒有辦法做到這一點。

提前致謝

試試這個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)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM