I am sending the output in html email, I want to add the code:
<font color="red"> NAME COLUMN record </font>
for the Name column records when the Count_1 & Count_2 are different. If they are equal no need to add the HTML tags. ( just to differentiate from others)
For eg:
In the above example, I have to add the tag to def and mno records.
awk '
# If we're on the first line, just print it unmodified.
NR==1 { print }
# If we're on other lines:
NR>1 {
# If the second record doesn't match the third, print the entire line($0) surrounded by tags.
if($2 != $3) printf("<font color="red">%s</font>\n", $0);
else print; # Otherwise, print the entire line unmodified.
}' < infile
Error:
Syntax Error The source line is 1.
The error context is
NR==1 { print } NR>1 { if($2 >>> [ <<<
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
awk: 0602-541 There are 2 missing ] characters.