in reply to Re: how to use matching operator on newlines
in thread how to use matching operator on newlines

This one-liner avoids that

That may very well be what the OP actually wants, but it is not equivalent his stated goal.

The OP's goal was to "translate double newlines to single newlines." Your code gets rid of blank lines. Consider what happens when a file starts with a blank line. Or, for another example, when there is a non-blank line followed by two blank lines. Etc.

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re^2: how to use matching operator on newlines