Hi, I have text file abc.txt. In this file, I have the following data.
Input:
Mr Smith & Mrs Smith
Mr Smith &apos Mrs Smith
Mr Smith & Mrs Smith
Mr Smith& Mrs Smith
Mr Smith &Mrs Smith
Output:
Mr Smith & Mrs Smith
Mr Smith &apos Mrs Smith
Mr Smith & Mrs Smith
Mr Smith& Mrs Smith
Mr Smith &Mrs Smith
In line 3, 4, and 5. I want to change & sign to & word but do not want to change anything in line 1, and line 2. If I use
sed 's/&/&/g' abc.txt
command, it changes to & everywhere.
Thanks for your help
Naveed