2

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

pkc456
  • 8,350
  • 38
  • 53
  • 109
earlleaps
  • 43
  • 1
  • 1
  • 4

2 Answers2

9

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.

Lars Fischer
  • 9,135
  • 3
  • 26
  • 35
5

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.

wpnpeiris
  • 766
  • 4
  • 14
Kaven Zheng
  • 51
  • 1
  • 1