I received some large CSV files that needed importing into a database, but unfortuntely there were hundreds of lines that contained line feeds so they would not import correctly.

Every “valid” line started with [email protected], so it was easy to find invalid lines with the following:

Notepad++ Doesn't Start With!

Using this, I then created a macro as follows:

  • F3 - find next instance
  • Backspace - removes the linefeed
  • Type “\r\n” so the fact that there was a line feed can still be determined

You can then run the macro to the end of the file, and all records were formatted to not span multiple lines.

Notepad++ Run Macro!