Wierd awk error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All

I'm trying extract some data from a file using awk. However I get errors that
I don't understand.

My awk file (crds.awk) looks like
/= DATASET/     { ds = $3; }
/xangst/        {if (ds == 1) {ln = 1; print $2,$3,$4 }}
{if ((ln > 0) && (ln < 61))     {if (ln!=1) {print $1,$2,$3} ln+=1 }}

and I execute it with
awk -f crds.awk c60*.out
but get the following error
awk: crds.awk:3: /x
awk: crds.awk:3:  ^ invalid char '' in expression

If I execute it from the command line like
awk '/= DATASET / {ds=$3} /xangst/ {if (ds==1) {ln=1; print $2,$3,$4 }}\
  {if ((ln > 0) && (ln < 61)) {if (ln!=1) {print $1,$2,$3} ln+=1 }}'
 c60*.out\
 > c60_d4.crd

I don't get any error.
Does anyone know a good tutorial for awk? According the one I using
http://www.vectorsite.net/tsawk1.html#m3 this seems OK.

Thanks
Torben


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux