I have a text file that is | delimited and is over 59,000 line long. How can I remove the carriage returns so each line is one record?

Here is what the current file looks like:- enter image description here

Here is what I need it to look like:- enter image description here

Any help would be awesome

2 Answers

Do a regular expression find/replace like this:

  • Open Replace Dialog
  • Find What: [^|\n\r]\R
  • Replace With: \1
  • check regular expression
  • click Replace or Replace All

It matches OS-linebreaks (\R) that are not (^) preceded by a | or \r or \n. Should work with any EOL convention.

In notepad++, you can actually open the search box, check the option for "extended search" in the search mode, and replace \R with blanks. This will help you replace the carriage return characters...

This also works for the other special chars such as \t, \n, etc.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy