There are many ways to do this either using a tool , custom scritps , regex or inbuilt option in the editors like notepad++. But here I am going to share a simplest solution which I am using regularly in my day to day activities .
Just do find option usually CTRL + F or CMD + F and
- put this value
^(?:[\t ]*(?:\r?\n|\r))+
and enable regex find . - in the replace option if you prefer just one empty line then add
\n
else leave empty.
Apply and enjoy the magic of formatted code