6

I have some huge CSV files where sometimes the lines end with LF instead of CRLF, for example:

pippo LF
pluto CRLF

I want to convert these two lines into a single line, like pippo pluto CRLF.

I'm trying to do this in Notepad++ (Windows 7), but I'm not able to do it...

Henke
  • 4,445
  • 3
  • 31
  • 44
Antonio
  • 367
  • 2
  • 4
  • 11
  • So you don't want to replace all occurrences of `LF` with `CRLF`? – Instead, do you want to _remove_ all occurrences of `LF`? (If I misunderstood you, my edit is wrong.) – Henke Sep 09 '22 at 14:15

3 Answers3

10

To do so:

Ctrl + F
Go to the "Replace" tab
In "Find What" paste: ([^\r])\n
In "Replace with" paste: \1
Choose "Regular expression" in "Search Mode"
Click "Replace All"
Henke
  • 4,445
  • 3
  • 31
  • 44
Martin
  • 101
  • 1
  • 3
4

In "Edit" menu, choose "Convert line feed" and "Convert to windows format (CRLF).

NB: I'm not quite sure of the labels because I have not an english version of Notepad++.

Notepad++ menus evolve from version to version. In the English version of Notepad++ 6.3.2 from the Edit menu, select EOL Conversions => Windows Format.

AdrianHHH
  • 13,492
  • 16
  • 50
  • 87
Toto
  • 89,455
  • 62
  • 89
  • 125
1

Just replace all the \r with "".

To do so:

  1. Ctrl+F
  2. Go to "Reaplace" tab
  3. In "Find What" paste: \r
  4. In "Replace with" paste: ""
  5. Choose "Extended" in "Search Mode"
  6. Replace All
Eugene S
  • 6,709
  • 8
  • 57
  • 91
  • 2
    Hi, I solved using a trick: Replace \n with null, and after that replace \r with \r\n. Thanks – Antonio Oct 04 '13 at 09:16