I'm a newbie to AWK and now i need to write a script that would extract some numerical values from the source file and print them in an appropriate way to an output file. AWK reports a syntax error concerning operator "if" and { -like gaps. I don't know, what is the problem, everything seems to be ok. Please give me some piece of advice. Thank you!
Here is an abstract from the script code:
BEGIN {
flag=1
flagef=1
}
#
flagef==1 {
if ($1=="basis") {
efline=NR+10
flagef=2
}
}
flagef==2 && NR==efline {
ef=$2
flagef=0
}
flag==1 {
if ($1=="basis") {
line=NR+3
flaga=1
flag=0
}
}
flaga==1 && NR==line {
print (%2/1000,".0") $5
flaga=2
line2=NR+1
}
Here is an abstract from the script code:
BEGIN {
flag=1
flagef=1
}
#
flagef==1 {
if ($1=="basis") {
efline=NR+10
flagef=2
}
}
flagef==2 && NR==efline {
ef=$2
flagef=0
}
flag==1 {
if ($1=="basis") {
line=NR+3
flaga=1
flag=0
}
}
flaga==1 && NR==line {
print (%2/1000,".0") $5
flaga=2
line2=NR+1
}