Hi All Sorry about the last mail. I don't know what happened. I hope this is readable. I'm trying extract some data from a file using awk. However I get errors that I don't understand. My awk file 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 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