Hey,
I have the following for-loop:
for i in 0_bla_*
do
cat $i |awk -v filename=$filename '{if (NR>11) {anz=anz+1}}END{printf("%3$s %1$s %2$s \n", NR-1, anz, filename)}' > $i.dat
done
I want to pipe the filename from cat to awk. But it doesn't work. Has anyone an idea?
Thanks for any...
aaargh,
I found the mistake. I had a sprintf command within awk and used more arguments then existed.
Like: sprintf("%7$s, a, b)
Thanks alot for help,
Ergy
hey,
I don't know, what I am doing wrong, but my for-loop is not working anymore.
I always get the error:
"awk: cmd. line:8: (FILENAME=- FNR=1) fatal: arg count 8 greater than total number of supplied arguments"
cat input_jal.dat |awk '{
zaehler=0
for (zaehler=0;zaehler<=41;zaehler++)
{
}...
Hey,
I guess it is very easy what I am trying to do, but I don't know how...
cat input.dat |awk '{
function acos(x) { return atan2(sqrt(abs(1-x*x)), x) }
function asin(x) { return atan2(x, sqrt(abs(1-x*x))) }
function pi() { return 2*asin(1);}
gamma=acos(($1*$1)/(2*$3*$1))
print gamma
}'...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.