Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: ergy
  • Order by date
  1. ergy

    cat piping awk: filename as variable

    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...
  2. ergy

    problems with for-loop

    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
  3. ergy

    problems with for-loop

    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++) { }...
  4. ergy

    piping file and providing function

    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 }'...

Part and Inventory Search

Back
Top