need help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need help
# 8  
Old 06-21-2011
Code:
 
bash-3.00$ nawk '/Record/ {for (i=0;i<6;i++) { if(i==0){ record_name = $0 } getline;} indx_value=index($0,":"); val=substr($0,indx_value+1,length($0)); if ( length(val) == 0) printf ("%s\n",record_name);}' test
 
Record Number [841]*******
Record Number [843]*******
 
bash-3.00$ cat test 
Record Number [840]*******
ugdRec1.ban :
0ugdRec1.bill_seq_no :
0ugdRec1.subscriber_no :
ugdRec1.channel_seizure_dt : 20110618090132
ugdRec1.message_switch_id : 5402
ugdRec1.resource_no : ******
Record Number [841]*******
ugdRec1.ban :
0ugdRec1.bill_seq_no :
0ugdRec1.subscriber_no :
ugdRec1.channel_seizure_dt : 20110618090132
ugdRec1.message_switch_id : 5402
ugdRec1.resource_no :
Record Number [842]*******
ugdRec1.ban :
0ugdRec1.bill_seq_no :
0ugdRec1.subscriber_no :
ugdRec1.channel_seizure_dt : 20110618090132
ugdRec1.message_switch_id : 5402
ugdRec1.resource_no : ******
Record Number [843]*******
ugdRec1.ban :
0ugdRec1.bill_seq_no :
0ugdRec1.subscriber_no :
ugdRec1.channel_seizure_dt : 20110618090132
ugdRec1.message_switch_id : 5402
ugdRec1.resource_no :

unless, you give the exact input with correct format, i cannot help you
# 9  
Old 06-21-2011
hi

Hi itkamaraj,

It working.......I dont know what is the pblm in previous one. but i close my console and re-run the cmd.

Smilie

Appriciate for help and patience also.

Regards,
Venum
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question