removing newlines after a certain word.

Hello! This is my first post here.

I have a file with text like:

A</title>
B
C</title>
D

I need to format it to:

AB
CD

I am trying to use sed:

sed 's/<//title>\n/ /g' file > newfile

to delete </title> and the newline character, but the file is unchanged because there are apparently no instances of that
I also looked into: tr -d '</title>\n'
but no luck. I can tell it is whatever is between </title> and the newline that is causing my trouble... Any help would be appreciated!!!
-Joe

awk -F \< '{printf /title/?RS $1:$1}' infile

Hi, and welcome :slight_smile:

You almost had it.

$ sed 'N;s#</title>\n##' file1
AB
CD

Or, more accurately:

$ sed '/<\/title/{N;s#</title>\n##;}' file1
AB
CD

Thank you so much!
Just what I was looking for. I am processing a bunch of twitter hash-tags and their corresponding times in a bash script.

-Joe