I have some huge csv files where sometimes the lines end with LF
instead to CRLF
, ie:
pippo LF
pluto CRLF
I would have a line like pippo pluto CRLF
I'm trying to use notepad++ under Windows 7 but I'm not able to do that...
A CSV file contains a set of records separated by a carriage return/line feed (CR/LF) pair (\r\n), or by a line feed (LF) character. Each record contains a set of fields separated by a comma. If the field contains either a comma or a CR/LF, the comma must be escaped with double quotation marks as the delimiter.
When working with a CSV file it is often necessary to find data contained within and sometimes replace it. Find & Replace is used for just this. You can access it from the Edit > Find & Replace menu or by pressing Ctrl-F on the keyboard.
To do so:
Ctrl+F
Go to "Reaplace" tab
In "Find What" paste: ([^\r])\n
In "Replace with" paste: \1
Choose "Regular expression" in "Search Mode"
Replace All
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.
Just replace all the \r
with ""
.
To do so:
Ctrl+F
\r
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With