Hi there,

instead of first writing the file and then processing it with awk, pipe 
the ns output directly through awk so only the lines you are interested 
in are ever written to disk:

set file [open "| awk -f myfilter.awk > short_tracefile.tr" w];

myfilter.awk should contain your awk commands. You can also put the 
commands directly into the .tcl script, just be sure to escape all quote 
marks as needed. You can also use any other command, eg. grep or a 
concatenation of several commands (just pipe one into the next) to 
pre-process your file.

This is the most efficient way to save time and disk space, the only 
drawback is that you can't later on decide that you want to look at 
other data since only the filtered data is written.


good luck,
     Martina Umlauft        [EMAIL PROTECTED]
-----------------------------------------------------
                            http://frauenweb.at/~tina

ns user schrieb:
> hi all,
> 
> i'm using ns 2.29 to simulate a large wireless topologies (more than 100 
> nodes). the goal of my simulations is to compute collisions rate. so i 've 
> enabled MAC trace and i'm using awk to filter only lines where there is 
> collision (if $1 = 'D'  $5 = 'MAC').
> but the problem is that the simulation take a lot of time ( more than 1 hour) 
> because of the trace file that exceed 60 Mo in some cases. So i'm looking if 
> there is not an other method to calculate the collision rate
> 
> please help me it's urgent
> 
> 
> 
> 
>       
> 
>       
>               
> ___________________________________________________________________________ 
> Découvrez un nouveau moyen de poser toutes vos questions quel que soit le 
> sujet ! 
> Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et 
> vos expériences. 
> http://fr.answers.yahoo.com 

Reply via email to