Code:
#!/bin/awk -f
BEGIN {
FS = ";";
x=0;
}
NF==1 && x==0{
x=1;
split($0,a," ");
print;
print "===================================" >> "Error.txt";
next;
}
NF==1{
print;
next;
}
{
if ($5>=10 && $5<40){printf ("<Minor> %s : %-11s%-14s%-10s%-13s%-11s%-10s%-13s%-11s\n", a[3],$1, $2, $3, $4, $5, $6, $7, $8) >> "Error.txt"};
if ($5>=40 && $5<60){printf ("<Major> %s : %-11s%-14s%-10s%-13s%-11s%-10s%-13s%-11s\n", a[3],$1, $2, $3, $4, $5, $6, $7, $8) >> "Error.txt"};
if ($5>=60){printf ("<Critical> %s : %-11s%-14s%-10s%-13s%-11s%-10s%-13s%-11s\n", a[3],$1, $2, $3, $4, $5, $6, $7, $8) >> "Error.txt"};
if ($8>=10 && $8<40){printf ("<Minor> %s : %-11s%-14s%-10s%-13s%-11s%-10s%-13s%-11s\n", a[5],$1, $2, $3, $4, $5, $6, $7, $8) >> "Error.txt"};
if ($8>=40 && $8<60){printf ("<Major> %s : %-11s%-14s%-10s%-13s%-11s%-10s%-13s%-11s\n", a[5],$1, $2, $3, $4, $5, $6, $7, $8) >> "Error.txt"};
if ($8>=60){printf ("<Critical> %s : %-11s%-14s%-10s%-13s%-11s%-10s%-13s%-11s\n", a[5],$1, $2, $3, $4, $5, $6, $7, $8) >> "Error.txt"};
x=0;
printf ("%-11s%-14s%-10s%-13s%-11s%-10s%-13s%-11s\n", $1, $2, $3, $4, $5, $6, $7, $8)
}