Thread: How to increment a column in AWK
hi,
want make graph of karplus function
f($1) = 15.3*(cos((180/$pi)*$1+120))**2-6.2*cos((180/$pi)*$1+120)+1.5
want make text file awk, learning experience away libre office.
want like
0 f(0)
1 f(1)
2 f(2)
3 f(3)
etc. can graph grace. i've found numerous reference working from file never creating 1 awk.
thought of (pca perl math script, , doesn't work)
but can't find information how far take incrementation.code:awk 'begin {t=0} {print $1, pca '15.3*(cos((180/3.14)*$1+120))**2-6.2*cos((180/3.14)*$1+120)+1.5', t++}'
appreciated!
-dave![]()
use for-loop in begin block.
what you're doing doing calculation of first field of each line of input, doesn't sound want that.code:awk ' begin { (t=0;t<100;t++) { print t, 15.3*...; } }'
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] How to increment a column in AWK
Ubuntu
Comments
Post a Comment