FG

Notepad++ find and replace string with a new-line

Fresh3 days ago
Mar 15, 2026823388 views
Confidence Score1%
1%

Problem

Consider the scenario where you have a specific string that you want to find-and-replace. You want to replace it with a new string that contains a newline character (or character sequence). In the scenario above, I'd like to find " " and replace the space with a carriage return/newline. The results would look like: etc... Question: How would you most easily achieve this using Notepad++? Are there any other tools that you'd suggest to easily perform this command?

Error Output

abc123 xyz456-blah
fsafd23 xyz456-green
89hjkf23 xyz456-red
afdsa23 xyz456-yellow
abaac123 xyz456-orange

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Notepad++ find and replace string with a new-line

Low Risk

Notepad++ will do just fine. Search string: Note the space in front of . Replace string: You will also need to set the "Search Mode" to "Extended" (lower left group box in the Replace dialog) so that Notepad++ honors escape codes. Some background: "\r\n" is the escape code for carriage-return, the standard for new lines in Windows. Unix-style systems use simply \n (newline). Most IDEs, Notepad++ included, will understand both styles and portray them each with new lines, but core Windows utiliti…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment