Hi frnds,
one my frnds has given resolution for my problem as below. it working great , but i couldnt understand somethings in the script.
Why ++ operator after the function calling. how these each block working. will each run for each input line sequencially or one block for all the lines and next block execeted? plz clarify.
The script is
# ora.sh
awk -v Outfile=ora.txt '
/^ORA-/ {
split($0, f, "\"");
Target_schema = f[2];
Target_table = f[4];
Ora_error = $0;
}
/Targ Rowid=/ {
Rejected_count++ ;
Get_detail++;
printf "#%d => %s\n", Rejected_count, Ora_error;
next;
}
/^)/ && Get_detail {
print Rejected_count,Values_detail > Outfile;
Values_detail = "";
Get_detail = 0;
next;
}
Get_detail {
sub(/\(.*\):/,"=");
Values_detail = Values_detail $0 "|"
}
END {
print "Total Lines in Session Log",FILENAME,"is :",NR;
print "Total Nr of Rejected Records Captured in Sesslog is :",Rejected_count;
}
' ora.log
[/SIZE][/FONT][/SIZE][/FONT]