The best way is to  create a script that does the job for you. 

I would do it as follows (considered that the trace files are all in the
same directory and you execute the script from that directory as well.
Otherwise you need to alter the script a little bit.):

#!/bin/bash
touch results

for trace_file in `ls *.tr`
do
  echo "===================================" >> results
  echo "Results for file $i" >> results
  echo "===================================" >> results
  awk -f awkfile.awk $i >> results
done



Faramarz Kazemainy wrote:
> 
> 
> Dear all,
> Would you please elaborate on the following points?
> - I have 130 ns2 trace files. How can I use a single command to do them
> all?
> - How can I send the results to a single file?
> 
> I have found this:
> 
> awk -f awkfile.awk tracefile1.trace tracefile2.trace
> 
> here:
> http://www.gnu.org/software/gawk/manual/html_node/One_002dshot.html#One_002dshot
> 
> But the result is a single output which is a kind of average of both trace
> files.
> 
> I really appreciate your cooperation.
> Kindest regards,
> Faramarz
> 
> 
-- 
View this message in context: 
http://old.nabble.com/How-send-AWK-result-to-an-output-file--tp34250333p34250378.html
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to