Here is my script.
********************************************************
test.ksh
for i in $dir
do
test.awk i > $dir/(basename i)_C
done
**********
test1.awk
BEGIN{OFS=FS="*"}
/QR/{
for (j=1;j<=NF-7;j++) {
if ($j ~ /QR/ && $(j+1)=="XA" sub(/Z/,"K",$(j+7))
print $0
}
}
*****************************************************
In test.ksh where it is printing the out put, if the if condition satisfies, then only I want to create a file *_C, if it does not I don't want the file created. The above script is creating a *_C file for all the files in directory $dir. Please help. TIA.
********************************************************
test.ksh
for i in $dir
do
test.awk i > $dir/(basename i)_C
done
**********
test1.awk
BEGIN{OFS=FS="*"}
/QR/{
for (j=1;j<=NF-7;j++) {
if ($j ~ /QR/ && $(j+1)=="XA" sub(/Z/,"K",$(j+7))
print $0
}
}
*****************************************************
In test.ksh where it is printing the out put, if the if condition satisfies, then only I want to create a file *_C, if it does not I don't want the file created. The above script is creating a *_C file for all the files in directory $dir. Please help. TIA.