Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with printing

Status
Not open for further replies.

Meher1

Programmer
Jun 4, 2003
7
US
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)==&quot;XA&quot;) sub(/Z/,&quot;K&quot;,$(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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top