Hi there!

I think you sent this email last May

I was wondering if the script you sent is correct.
I mean :

set tr [open "| awk -f filter.awk >out.tr" w]
$ns trace-all $tr

I mean correct in term of executing the awk file without consuming disk space
(no big trace files, just the results we want to see using awk) AND at the
same time it gives the same results as if we have the whole trace file and we
filter it by the awk file

I did try ur scripts, and did play with it as well, still doesnt give me the
expected results

So I am just wondering if this script is correct? or if there is any
additional script somewhere else as well!

Regards
Tariq



>===== Original Message From Martina Umlauft <[EMAIL PROTECTED]> =====
>Hi!
>
>Instead of changing the C++ source you can pipe the trace output through
>awk before writing it to the trace file. This takes a little bit of
>computing power and (depending on the script) a bit of memory. But you
>can also save quite a lot of disk space (eg. by on-the fly calculation
>of average values during the simulation) and you save on disk access times.
>
>I do this all the time and it is a lot more flexible than changing the
>source code because you can simply plug your awk script into the .tcl
>script and change it very quickly whenever you want.
>
>eg. in the .tcl do the following:
>
>set tr [open "| awk -f filter.awk >out.tr" w]
>$ns trace-all $tr
>
>in filter.awk put your awk script or; if the awk command is very simple,
>just do it directly in the .tcl . eg. to just print column 2 and 4 do
>the following:
>
>set tr [open "| awk '{print $2 \" \" $4}' >out.tr" w]
>
>don't forget that you have to escape any " with \ (as shown in the
>example above)!
>
>lg,
>     Martina Umlauft
>
>Diego Soares schrieb:
>> Thanks for the answer, but if i exclude the fields that i wanto to
>> eliminate, i get segmentation fault from the simulator, after I compile NS
>> again.
>>
>> What should I change to eliminate some fields????
>>
>>
>> On 5/6/06, Sita S. Krishnakumar <[EMAIL PROTECTED]> wrote:
>>> cmu-trace.cc
>>>
>>>
>>> Hello NS users,
>>>
>>> Which source code should I chance to write only the fields that I want
>>> in
>>> my
>>> trace files?? I am simulation Ad-Hoc networks using new-trace format!!!
>>>
>>> --
>>> Diego G. Soares
>>>
>>>
>>>
>>
>>
>> --
>> Diego G. Soares

Reply via email to