I can't find a suitable sed expression to remove a word followed by a line return (\n)
Test file is:
line1\n
line2\n
line3mark\n
line4\n
line5\n
and i want to remove all occurances of mark\n leaving, in this case:
line1\n
line2\n
line3line4\n
line5\n
have searched and can use:
sed 's/\n//g' test.file to remove ALL \n's
but
sed 's/mark\n//g' test.file does not work
Strangely, s/mark\n//g does seem to work ok in vi in interactive mode.
Any help greatly appreciated! I would like to understand how to do it using SED if possible as I am sure it is possible!! However, if it can be done another way then I'm also happy as long as its on the command line as it has to run over many files.
Many thanks.