[ILUG] can anybody explain thise awk script to me Please

hrishy hrishys at yahoo.co.uk
Wed Aug 29 09:44:53 IST 2001


 Hello

This is the text file opn which i run the awk script


cust_tab custid number 
cust_tab custname varchar2(20) 
cust_tab custaddr varchar2(40) 
cust_tab custphone varchar2(16) 
cust_tab updateuser varchar2(16) 
lang_tab langid number 
lang_tab langnam varchar2(30) 
lang_tab langdesc varchar2(30) 
lang_tab updateuser varchar2(16) 


awk script is 

BEGIN { 
prev_table="." 
} 
{ 
curr_table=$1 
if ( curr_table!=prev_table ) 
{ 
prev_table=curr_table 
printf("\nTable %s : %s",$1,$2) 
} 
else 
{ 
printf(",%s",$2) 
} 
} 

i get the output but can u please explain the if loop.

regards
hrishy


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie




More information about the ILUG mailing list