pcap to txt

913 views
Skip to first unread message

Lucas Duarte de Souza

unread,
Nov 10, 2013, 4:05:57 PM11/10/13
to ns-3-...@googlegroups.com
Hi guys,

I want to save files pcap in txt. Any suggestion?


thanks

Lucas Duarte de Souza

unread,
Nov 10, 2013, 4:39:36 PM11/10/13
to ns-3-...@googlegroups.com
I could, but i have one more doubt.

I want to manipulate pcap, to save that I want.

Example:
Output
0.559611 559611us tsft 24.0 Mb/s 5005 MHz 11a IP 192.168.1.2.49153 > 192.168.1.1.12345: UDP,


I want just :

0.559611 24.0

Konstantinos

unread,
Nov 10, 2013, 5:59:53 PM11/10/13
to ns-3-...@googlegroups.com
Hi, 

a quick google search gives an example of how you can convert pcaps to text file

one of which was 
http://blog.scorviafoundation.org/2012/12/09/and-the-story-begin/operating-system/how-to-convert-pcap-file-into-text/

Now, if you want only to get the first and fourth element of each line, you can use a script to get that
e.g. in awk script assuming that the original.txt file was the one with the full line after the pcap conversion, and clean.txt has only the first and fourth element:
awk '{ print $1 $4 "\n" } END{}' original.txt >> clean.txt

Lucas Duarte de Souza

unread,
Nov 10, 2013, 8:33:47 PM11/10/13
to ns-3-...@googlegroups.com


Em domingo, 10 de novembro de 2013 20h59min53s UTC-2, Konstantinos escreveu:
Hi, 

a quick google search gives an example of how you can convert pcaps to text file

I could.

one of which was 
http://blog.scorviafoundation.org/2012/12/09/and-the-story-begin/operating-system/how-to-convert-pcap-file-into-text/

Now, if you want only to get the first and fourth element of each line, you can use a script to get that
e.g. in awk script assuming that the original.txt file was the one with the full line after the pcap conversion, and clean.txt has only the first and fourth element:
awk '{ print $1 $4 "\n" } END{}' original.txt >> clean.txt

thanks
Reply all
Reply to author
Forward
0 new messages