THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Jamie Thomson

This is the blog of Jamie Thomson, a freelance data mangler in London

Replacing CRLF with LF using Notepad++

I’m putting this here for my own future reference as much as anything else however if anyone ever bingles their way here it should be useful for them too.

I have a text file that has CRLF line terminators (which Windows uses to terminate lines) that I want to replace with LF line terminators (the UNIX way). Notepad++ demonstrates this rather well:


Notepad++’s Find/Replace feature handles this requirement quite nicely. Simply bring up the Replace dialog (CTRL+H), select Extended search mode (ALT+X), search for “\r\n” and replace with “\n”:


Hit Replace All (ALT+A)….and job’s a good’un:


Easy when you know how!!!


UPDATE, turns out there’s an even easier way. From Eugene in the comments below:

Another option is to go to Edit -> EOL Conversion -> Unix Format.

Published Tuesday, August 07, 2012 12:50 PM by jamiet
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



Eugene said:

Another option is to go to Edit -> EOL Conversion -> Unix Format.

August 7, 2012 7:14 AM

jamiet said:


I did NOT know that.


August 7, 2012 7:31 AM

jbooker said:

Good to know about extended option.  

There's also a more advanced Find\Replace here:

TextFX | TextFx Quick | Find\Replace

This allows you to copy & paste multi-line char strings into F & R boxes.

August 7, 2012 9:13 AM

Paul said:

Thanks! I knew how to do this in Word but now I know Notepad++ too

November 6, 2012 8:47 AM

Alex said:

Thanks for this Blog and also Eugene's comment. You guys just solved my problem!

December 17, 2012 1:13 PM

Dan C said:

Thank you. This helped me solve this issue!

January 10, 2013 12:50 PM

Vernon said:

Thank you Eugene and Jamie,

February 18, 2013 9:16 PM

Veera Prasad said:

Thanks..this helps me a lot

February 26, 2013 10:34 AM

PU2MIX said:


April 2, 2013 7:45 AM

Jan said:

Thank you!

October 22, 2013 5:04 PM

Gab said:


October 30, 2013 10:56 AM

Ratanang said:

Super, Thanks a lot guys, you came to my rescue

October 30, 2013 12:05 PM

Rado said:

Thank You!

November 29, 2013 9:26 AM

dv said:

thanks mate!

June 24, 2014 9:48 AM

Martin said:

Thank you!    

July 5, 2014 6:44 AM

MR said:

I didn't realise the problem I was introducing using Notepad to edit a pac file i.e. the CRs at the end of the line.    Having stumbled across the need to use Notepad++, this page was just what I needed.   Everything explained as simply and crisply as possible.  Brilliant. Many thanks for your forethought and generosity in putting this information on the Web "for future reference"     Looks like it's getting quite a bit of that!

July 6, 2014 3:41 PM

Adrian B. said:

Thank you!

September 23, 2014 4:32 AM

Gail W said:

I googled "how to change crlf to lf" and this was the first result. Considering that I use Notepad++ as my editor, I was delighted to get something that was exactly what I needed. I had a feeling there might be a command in Notepad++, I just hadn't looked in the right place.


October 7, 2014 3:11 PM

Don said:

Seems like this will go on helping people (like me) for a while to come, so thanks a lot Jamie. I just suddenly saw all these CRLFs appear in my Notepad++ document and still can't tell what I did to get them there.

Wanted to get rid of them and Google got me here. So many thumbs up to people like you who are willing to put things up to help people like me.

October 17, 2014 4:12 PM

Christine said:


October 28, 2014 11:10 AM

Anupama said:

Thank you. It was helpful for me

October 29, 2014 2:50 AM

Tom W said:

Ditto Gail W's comments!

December 15, 2014 4:10 PM

Andrew said:

Thanks heaps for the info guys, both to Jamiet and Eugene :D

February 11, 2015 11:52 AM

Anatoly said:

Thanks a lot!

February 15, 2015 10:27 PM

Leave a Comment


This Blog


Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement