Sure a <CR> means a line end in your file? While <LF> (*nix) and <CR><LF> (DOS / Windows) usually do, a <CR> alone frequently means a "local line break" in a field. And <LF><LF> can stand for two lines, one with a text and one empty.
Normally each record within a file have a line end like <LF>. But sometimes some lines will be changed at Windows platform. Therefor it could happen that you have all different possibilities - as described above.
To place it here in a code-Fragment is not possible, because you won't see the line ends, or?
Above means: a line feed at the begin-of-line or at end-of-line will be removed. You have to know that in sed , the line end is implicitly known, no <LF> in pattern space. Thus a really existing "extra" <LF> would mean an empty line and needs to be removed.