I want to count the number of words and print the matched pattern lines which matches exactly with following pattern:abc-ERROR:The input File contains: # abc-ERROR: xyxxkkfgfr# def-Error: aaaaaa# abc-ERROR.cppThe output should be: 1   (count) # abc-ERROR: xyxxkkfgfr   (line)
How to count the number of words and print the lines that match exactly a given pattern?
text processing;sed;grep;awk