I am looking fot tcl script which finds no of Errors/Warnings in a file
The file may have format like:
xx : Severity: Warning Occurrence: 2
yy :Severity: Error Occurrence: 2
ZZ:Severity: Error Occurrence: 4
at the end I want to have Warnings =2
Error =6
while { [ gets $fp line ] >= 0 } {
if { [ regexp "^Severity:\s+Warning\s+Occurrence:\s+\d+" $line ] } {
puts $line
regsub -all {(\s+)} $line { } temp_war
set Warning [ lindex [ split $temp_war " " ] 2 ]
}
The file may have format like:
xx : Severity: Warning Occurrence: 2
yy :Severity: Error Occurrence: 2
ZZ:Severity: Error Occurrence: 4
at the end I want to have Warnings =2
Error =6
while { [ gets $fp line ] >= 0 } {
if { [ regexp "^Severity:\s+Warning\s+Occurrence:\s+\d+" $line ] } {
puts $line
regsub -all {(\s+)} $line { } temp_war
set Warning [ lindex [ split $temp_war " " ] 2 ]
}