How do I search on a particular pattern, and if a line contains that pattern, add a comment in front of the line - leaving the rest of the line unchanged.
Input file: (I want to only comment out the line that contains 'WOW1' - not WOW11')
abcd WOW1 cdef
abcd WOW11 cdef
Output file:
#abcd WOW1 cdef
abcd WOW11 cdef
Input file: (I want to only comment out the line that contains 'WOW1' - not WOW11')
abcd WOW1 cdef
abcd WOW11 cdef
Output file:
#abcd WOW1 cdef
abcd WOW11 cdef