LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 09-10-2007, 07:14 AM   #1
mruknown1
LQ Newbie
 
Registered: Sep 2007
Posts: 6

Rep: Reputation: 0
awk/perl script for extract data


Hello... i need awk/perl script that can calculate packet size.

for example based on this output, each column have their own meaning
column1=send/received, drop,...
column2= timestamp
column3=node
column4=level
column5=flag
column6=packetID
column7=packettype
column8=packetsize
.....
.....

1. How if i want to calculate total PACKETSIZE RECEIVED by NODE 5 with RTR LEVEL and DSR PACKETTYPE .From here i will try to manipulate the script so i can used it in my research.

2. How if i want to extract this output so i can create a new file that print 2 columns (TIMESTAMP and DSR) when NODE 5 RECEIVED DSR PACKETTYPE with RTR LEVEL.

thank you very much for any help...

s 84.456630640 _5_ AGT --- 0 cbr 512 [0 0 0 0] ------- [5:1 6:1 32 0] [0] 0 1
r 84.456630640 _5_ RTR --- 0 cbr 512 [0 0 0 0] ------- [5:1 6:1 32 0] [0] 0 1
s 84.460452677 _5_ RTR --- 1 DSR 32 [0 0 0 0] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461724861 _4_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461724909 _0_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461725322 _6_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461725410 _1_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461725471 _2_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
s 84.462207082 _6_ RTR --- 2 DSR 44 [0 0 0 0] ------- [6:255 5:255 254 5] 2 [0 1] [1 1 2 5->6] [0 0 0 0->0]
r 84.466670604 _5_ RTR --- 2 DSR 44 [13a 5 6 800] ------- [6:255 5:255 254 5] 2 [0 1] [1 1 2 5->6] [0 0 0 0->0]
SFESTs 84.466670604 _5_ 0 [5 -> 6] 1(1) to 6 [5 |6 ]
s 84.466670604 _5_ RTR --- 0 cbr 548 [0 0 0 0] ------- [5:1 6:1 32 6] [0] 0 1
r 84.472832542 _6_ RTR --- 0 cbr 548 [13a 6 5 800] ------- [5:1 6:1 32 6] [0] 1 1
r 84.472832542 _6_ AGT --- 0 cbr 512 [13a 6 5 800] ------- [5:1 6:1 32 6] [0] 1 1
s 89.865825846 _5_ AGT --- 3 cbr 512 [0 0 0 0] ------- [5:1 6:1 32 0] [1] 0 2
r 89.865825846 _5_ RTR --- 3 cbr 512 [0 0 0 0] ------- [5:1 6:1 32 0] [1] 0 2
SFESTs 89.865825846 _5_ 3 [5 -> 6] 1(1) to 6 [5 |6 ]
s 89.865825846 _5_ RTR --- 3 cbr 548 [0 0 0 0] ------- [5:1 6:1 32 6] [1] 0 2
SSendFailure 89.907170846 _5_ 3 2 5:1 6:1 5->6 2 2 2 2 [|5 6 ]
s 89.912216246 _5_ RTR --- 4 DSR 32 [0 0 0 0] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
r 89.913368448 _0_ RTR --- 4 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
s 89.913368448 _0_ RTR --- 5 DSR 48 [0 0 0 0] ------- [0:255 5:255 255 5] 2 [0 2] [1 2 3 5->6] [0 0 0 0->0]
r 89.913368578 _4_ RTR --- 4 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
s 89.913368578 _4_ RTR --- 6 DSR 48 [0 0 0 0] ------- [4:255 5:255 255 5] 2 [0 2] [1 2 3 5->6] [0 0 0 0->0]
r 89.913368941 _1_ RTR --- 4 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
s 89.913368941 _1_ RTR --- 7 DSR 48 [0 0 0 0] ------- [1:255 5:255 255 5] 2 [0 2] [1 2 3 5->6] [0 0 0 0->0]
r 89.913369041 _2_ RTR --- 4 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
r 89.919259468 _5_ RTR --- 7 DSR 48 [13a 5 1 800] ------- [1:255 5:255 255 5] 2 [0 2] [1 2 3 5->6] [0 0 0 0->0]
SFESTs 89.919259468 _5_ 3 [5 -> 6] 3(1) to 1 [5 |1 6 ]
s 89.919259468 _5_ RTR --- 3 cbr 552 [13a 6 5 800] ------- [5:1 6:1 32
 
Old 09-10-2007, 03:56 PM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
Well, we can't do your work for you, of course. But maybe we can help.

What does your script look like so far?
 
Old 09-11-2007, 04:42 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


http://www.linuxquestions.org/questi...d.php?t=582907
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to acess Variable defined in perl script inside an awk call sumin Programming 3 04-26-2007 05:19 AM
looking for a perl script to convert html table data into a csv file swiftguy121 Linux - Software 2 04-25-2007 07:28 PM
perl script, paired data disruptive Programming 2 02-20-2007 07:51 AM
How to extract information from a large data pool with AWK script? underskinned Programming 2 11-23-2006 09:26 PM
How do I zip and attach the output data of a grep | awk | mail shell script? 360 Programming 1 05-08-2002 08:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration