[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Problem with gawk code



Hi Difa,

Thank you for your mail. I downloaded awk->c converter
 (awake-0.7.5). And I convert my awk code to c  (awka
-f  /home/test.awk> /home/test.c) but I have a
question.  I had added my awk file to my tcl file
through procedure monitor which called before finish
proc.
proc monitor { } {

global dropcount 

set thruputs [exec gawk -f /home/test.awk
/home/test.tr] 




puts $f0 "drop:$dropcount"


}

but I don't know where and how I should call and exe
test.c in my tcl code. I would be very grateful if you
can help me in this regards.

Regards,
Gosh

There is the source of test.awk:

BEGIN {soo="";} {if (index($1,"0") == 0) { sum += $7;
soo = sprintf("%s %d", soo, $7);}} END {printf "%s
%d", soo, sum;}

--- Di-Fa Chang <[email protected]> wrote:
> you may want to read some suggestion on awk coding:
>  
>
http://www.isi.edu/nsnam/archive/ns-users/webarch/2000/msg06038.html
> or try the awk-to-c converter:
>  
>
http://www.isi.edu/nsnam/archive/ns-users/webarch/2000/msg06041.html
> Search the mail archive for 'awk script', you can
> find more:
>   http://www.isi.edu/nsnam/htdig/search.html
> 
> - difa
> 
> On Fri, 9 Nov 2001, gosh larous wrote:
> 
> > Hi all,
> >
> > I am using gawk to read my trace file and find
> loss
> > and jitter in the simulated network. The size of
> the
> > trace file is about 604 Mb. Without codes related
> to
> > gawk program runs in 4 to 5 hours but with adding
> > codes related to gawk it gets more than 2 days to
> run
> > and I thought maybe there was something wrong
> about it
> > and stopped running the program. When I make my
> > program smaller it  works. Do you think that much
> time
> > for running the program is usual and I must wait
> to
> > get the result or it is some thing wrong about
> what I
> > do? Or if there is any better and sooner way for
> > measuring jitter and loss in the network. Any
> feedback
> > would be appreciated.
> >
> > Regards,
> > Gosh
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Find a job, post your resume.
> > http://careers.yahoo.com
> >
> 


__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com



__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com