{"id":9886,"date":"2019-06-21T06:41:14","date_gmt":"2019-06-21T06:41:14","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=9886"},"modified":"2020-12-03T14:28:50","modified_gmt":"2020-12-03T14:28:50","slug":"notepad-plus-find-and-replace-text","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/notepad-plus-find-and-replace-text\/","title":{"rendered":"Notepad++ Tips: Find and Replace, and Text Manipulation Examples"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-9890\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/notepad-plus-icon.png\" alt=\"notepad++ icon\" width=\"155\" height=\"155\" \/>Notepad++ is an excellent light-weight <a href=\"https:\/\/www.winhelponline.com\/blog\/replace-notepad-text-editor-notepad-plus-association\/\">text editor<\/a> with many useful features. With Notepad++, you can find and replace text in the current file or in multiple files in a folder recursively. You can also find and replace text using regex.<\/p>\n<p>This post has many Notepad++ find &amp; replace examples and other useful Notepad++ tips for different scenarios.<!--more--><\/p>\n<div id=\"toc\">\n<h4>Notepad++: Text file manipulation examples<\/h4>\n<ol>\n<li><a href=\"#remove_path_from_filename\">Remove Path from the File name in a text file<\/a><\/li>\n<li><a href=\"#remove_filename_from_path\">Remove File name from Full Path in a text file<\/a><\/li>\n<li><a href=\"#remove_number_of_chars_beginning_line\">Remove a fixed number of characters from the beginning of each line<\/a><\/li>\n<li><a href=\"#delete_chars_exceed_n_chars\">Delete characters that exceed &#8216;n&#8217; number of characters in a text file<\/a><\/li>\n<li><a href=\"#remove_text_after_a_char\">Remove text after a specific character from each line in a text file<\/a><\/li>\n<li><a href=\"#remove_trailing_leading_whitespace\">Remove leading or trailing space from each line in a text file<\/a><\/li>\n<li><a href=\"#delete_blank_lines\">Delete blank lines in a text file<\/a><\/li>\n<li><a href=\"https:\/\/www.winhelponline.com\/blog\/remove-lines-containing-word-string-text-file\/\" target=\"_blank\" rel=\"noopener noreferrer\">Remove Lines Containing a Word or String in a Text File<\/a><\/li>\n<li><a href=\"#remove_text_after_comma_occurrence\">Remove text after &#8216;n&#8217;th occurrence of comma or symbol<\/a><\/li>\n<li><a href=\"#prefix_word_each_line_text_file\">Prefix each line with a word or phrase in a text file<\/a><\/li>\n<li><a href=\"#suffix_word_each_line_text_file\">Suffix each line with a word or phrase in a text file<\/a><\/li>\n<li><a href=\"#remove_duplicate_rows_without_sorting\">Remove duplicate rows in a text file without sorting the rows<\/a><\/li>\n<li><a href=\"#newline_at_a_character\">Insert new line (carriage return) at a specific character or string<\/a><\/li>\n<\/ol>\n<\/div>\n<h3><a id=\"remove_path_from_filename\"><\/a>Remove Path from the File name in a text file<\/h3>\n<p>If you have full paths for files in a text file and want to remove the path (i.e., only want the file name), use the following Find &amp; Replace technique:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9887\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/notepad-plus-remove-path-filename.png\" alt=\"notepad++ remove path from file name\" width=\"573\" height=\"356\" \/><\/p>\n<ol>\n<li>Bring up the Replace dialog (<kbd>Ctrl<\/kbd> + <kbd>H<\/kbd>) and use the following replace method:<\/li>\n<li>In the Find box, type <code>^.*\\\\<\/code><\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Leave the Replace box blank.<\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p><strong>::Before::<\/strong><\/p>\n<pre>C:\\Users\\ramesh\\Pictures\\Screenshots\\Screenshot 90.png\r\nC:\\Users\\ramesh\\Pictures\\Screenshots\\Screenshot 97.png\r\nC:\\Users\\ramesh\\Pictures\\Screenshots\\Screenshot 10.png\r\nC:\\Users\\ramesh\\Pictures\\Screenshots\\Screenshot 15.png<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>Screenshot 90.png\r\nScreenshot 97.png\r\nScreenshot 10.png\r\nScreenshot 15.png<\/pre>\n<hr \/>\n<h3><a id=\"remove_filename_from_path\"><\/a>Remove File name from Full Path in a text file<\/h3>\n<p>To remove the file name from a full path, use this search operator:<\/p>\n<ul>\n<li>Find what: <code>\\\\[^\\\\]+$<\/code><\/li>\n<li>Replace with: Leave empty<\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ul>\n<p><strong>::Before::<\/strong><\/p>\n<pre>D:\\Tools\\Sysinternals\\accesschk.exe\r\nD:\\Tools\\Sysinternals\\AccessEnum.exe\r\nD:\\Tools\\NirSoft\\AddrView.exe\r\nD:\\Tools\\Others\\activehotkeys.exe<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>D:\\Tools\\Sysinternals\r\nD:\\Tools\\Sysinternals\r\nD:\\Tools\\NirSoft\r\nD:\\Tools\\Others<\/pre>\n<p><strong>Tip:<\/strong> If you need the trailing slash after the folder path, you can use the following regex search instead.<\/p>\n<ul>\n<li>Find what: <code>(.*\\\\).*<\/code><\/li>\n<li>Replace with: <code>\\1<\/code><\/li>\n<\/ul>\n<hr \/>\n<h3><a id=\"remove_number_of_chars_beginning_line\"><\/a>Remove a fixed number of characters from the beginning of each line<\/h3>\n<p>To remove a fixed number of characters at the beginning of each line in a text file, use this regex search &amp; replace query:<\/p>\n<ol>\n<li>Find what: <code>^.{11}(.*)$<\/code><\/li>\n<li>Replace with: <code>$1<\/code><\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p>This deletes the first 11 characters from the starting of each line.<\/p>\n<p><strong>::Before::<\/strong><\/p>\n<pre>File Path: D:\\Tools\\Sysinternals\\accesschk.exe\r\nFile Path: D:\\Tools\\Sysinternals\\AccessEnum.exe\r\nFile Path: D:\\Tools\\NirSoft\\AddrView.exe\r\nFile Path: D:\\Tools\\Others\\activehotkeys.exe<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>D:\\Tools\\Sysinternals\\accesschk.exe\r\nD:\\Tools\\Sysinternals\\AccessEnum.exe\r\nD:\\Tools\\NirSoft\\AddrView.exe\r\nD:\\Tools\\Others\\activehotkeys.exe<\/pre>\n<hr \/>\n<h3><a id=\"delete_chars_exceed_n_chars\"><\/a>Delete characters that exceed the number of characters<\/h3>\n<p>To delete characters that exceed the number of characters in a text file, use this:<\/p>\n<ol>\n<li>Find what: <code>^.{19}\\K.*$<\/code><\/li>\n<li>Replace with: Leave blank<\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p>This deletes the characters that exceed 19 characters in each line.<\/p>\n<p><strong>::Before::<\/strong><\/p>\n<pre>The Quick Brown Fox is lazy\r\nThe Quick Brown Fox is very cute\r\nThe Quick Brown Fox jumps over the lazy dog<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>The Quick Brown Fox\r\nThe Quick Brown Fox\r\nThe Quick Brown Fox<\/pre>\n<hr \/>\n<h3><a id=\"remove_text_after_a_char\"><\/a>Remove text after a specific character from each line in a text file<\/h3>\n<p>To remove text <strong>after<\/strong> a specific character &#8212; e.g., a hyphen, from each line in a text file, use:<\/p>\n<ol>\n<li>Find what: <code>(.+)\\s*-\\s*(.+)<\/code><\/li>\n<li>Replace with: <code>$1<\/code><\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<div class=\"qt\">\n<p>To remove the text <strong>before<\/strong> a character (e.g., hyphen), use <code>$2<\/code> in the replace field:<\/p>\n<ol>\n<li>Find what: <code>(.+)\\s*-\\s*(.+)<\/code><\/li>\n<li>Replace with: <code>$2<\/code><\/li>\n<\/ol>\n<\/div>\n<p>Alternatively, to remove text after a specific character or word, you can use the following, which looks easier:<\/p>\n<ol>\n<li>Find what: <code>-.*<\/code><\/li>\n<li>Replace with:\u00a0 leave it empty<\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p><strong>::Before::<\/strong><\/p>\n<pre>accesschk.exe - from Sysinternals\r\nAccessEnum.exe - from Sysinternals\r\nAddrView.exe - from NirSoft\r\nactivehotkeys.exe - from another vendor<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>accesschk.exe \r\nAccessEnum.exe \r\nAddrView.exe \r\nactivehotkeys.exe<\/pre>\n<p>You can also use it to remove text after a specific <strong>word<\/strong> (e.g., &#8220;from&#8221;).<\/p>\n<ol>\n<li>Find what: <code>from.*<\/code><\/li>\n<li>Replace with:\u00a0 leave it empty<\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p><strong>::Before::<\/strong><\/p>\n<pre>accesschk.exe from Sysinternals\r\nAccessEnum.exe from Sysinternals\r\nAddrView.exe from NirSoft\r\nactivehotkeys.exe from another vendor<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>accesschk.exe \r\nAccessEnum.exe \r\nAddrView.exe \r\nactivehotkeys.exe<\/pre>\n<hr \/>\n<h3><a id=\"remove_trailing_leading_whitespace\"><\/a>Remove leading or trailing space from each line in a text file<\/h3>\n<p>To remove the trailing and\/or leading whitespace from each line in a text file, use the Blank Operations menu.<\/p>\n<p>From the Edit menu in Notepad++, click <strong>Blank Operations<\/strong><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9888\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/notepad-plus-remove-leading-trailing-space.png\" alt=\"notepad++ tips - remove blank whitespace\" width=\"643\" height=\"128\" \/><\/p>\n<p>Choose one of the three options:<\/p>\n<ul>\n<li>Trim Trailing Space<\/li>\n<li>Trim Leading Space<\/li>\n<li>Trim Leading and Trailing Space<\/li>\n<\/ul>\n<hr \/>\n<h3><a id=\"delete_blank_lines\"><\/a>Delete blank lines in a text file<\/h3>\n<p>To delete empty\/blank lines in a text file, from the <strong>Edit<\/strong> menu in Notepad++, select <strong>Line Operations<\/strong>, and click <strong>Remove Empty Lines<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9889\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/notepad-plus-remove-empty-lines.png\" alt=\"notepad++ tips - remove empty lines\" width=\"701\" height=\"212\" \/><\/p>\n<p>To also remove lines containing blank characters or white spaces, click <strong>Remove Empty Lines (Containing Blank characters)<\/strong> option instead.<\/p>\n<p><strong>::Before:<\/strong><\/p>\n<pre>The Quick Brown Fox is lazy\r\n\r\n\r\nThe Quick Brown Fox is very cute\r\n\r\n\r\nThe Quick Brown Fox jumps over the lazy dog<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>The Quick Brown Fox is lazy\r\nThe Quick Brown Fox is very cute\r\nThe Quick Brown Fox jumps over the lazy dog<\/pre>\n<p><strong>Delete empty lines only in the selected rows<\/strong><\/p>\n<p>Note that the above command removes empty lines in the entire text file. To remove empty lines only within the text selection, use this search operator:<\/p>\n<ol>\n<li>Select the rows where you want to remove empty lines.<\/li>\n<li>Bring up the Replace dialog (<kbd>Ctrl<\/kbd> + <kbd>H<\/kbd>)<\/li>\n<li>In the <strong>Find what:<\/strong> box, type <code>\\n\\r<\/code><\/li>\n<li>Leave the <strong>Replace with:<\/strong> box empty<\/li>\n<li>Enable the <strong>In selection<\/strong> checkbox<\/li>\n<li>Select Search Mode to <strong>Extended<\/strong><\/li>\n<li>Click <strong>Replace All<\/strong><\/li>\n<\/ol>\n<p>That&#8217;s it! It deletes the empty rows within the <strong>selected rows<\/strong> only rather than the entire file.<\/p>\n<hr \/>\n<h3><a id=\"remove_text_after_comma_occurrence\"><\/a>Remove text after &#8216;n&#8217;th occurrence of comma or symbol<\/h3>\n<p>Suppose you have text in each line delimited by a comma or any other symbol. Example below:<\/p>\n<p><strong>::Before::<\/strong><\/p>\n<pre>------------------------------\r\nname,address,pin,landmark\r\n------------------------------\r\nramesh,10 san jose avenue,11011,near museum\r\npete,1 sf marg,45089,near childrens park\r\njohn,7 rcr,11909,near metro station<\/pre>\n<p>To remove text after the 3rd occurrence of the <em>comma<\/em>, use this find and replace search operator:<\/p>\n<ol>\n<li>Find what: <code>^([^,]*,[^,]*,[^,]*),.*$<\/code><\/li>\n<li>Replace with: <code>$1<\/code><\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p><strong>::After::<\/strong><\/p>\n<pre>--------------------------\r\nname,address,pin\r\n--------------------------\r\nramesh,10 san jose avenue,11011\r\npete,1 sf marg,45089\r\njohn,7 rcr,11909<\/pre>\n<hr \/>\n<h3><a id=\"prefix_word_each_line_text_file\"><\/a>Prefix each line with a word or phrase in a text file<\/h3>\n<p>To add a word or phrase (prefix) at the <strong>beginning<\/strong> of each line in a text file, use the following search &amp; replace operator:<\/p>\n<ol>\n<li>Find what: <code>^<\/code><\/li>\n<li>Replace with: <code>Some word or phrase<\/code><\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p><em>The above can be especially useful when creating a HOSTS file to block a list of certain Ad servers. Use <code>0.0.0.0 <\/code> with a trailing space in the <strong>Replace with:<\/strong> text box, and click Replace All. This adds the prefix string for each line (Ad server) in the text file.<\/em><\/p>\n<p><strong>::Before::<\/strong><\/p>\n<pre>ssp.adriver.ru\r\nr.adrolays.de\r\nadrotate.se\r\nwww.adrotate.net\r\nadrunnr.com<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>0.0.0.0 ssp.adriver.ru\r\n0.0.0.0 r.adrolays.de\r\n0.0.0.0 adrotate.se\r\n0.0.0.0 www.adrotate.net\r\n0.0.0.0 adrunnr.com<\/pre>\n<hr \/>\n<h3><a id=\"suffix_word_each_line_text_file\"><\/a>Suffix each line with a word or phrase in a text file<\/h3>\n<p>To add a word or phrase (suffix) at the <strong>end<\/strong> of each line in a text file, use the following search &amp; replace operator:<\/p>\n<ol>\n<li>Find what: <code>$<\/code><\/li>\n<li>Replace with: <code>Some word or phrase<\/code><\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li>Uncheck <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p><strong>::Before::<\/strong><\/p>\n<pre>D:\\Tools\\Sysinternals\\accesschk.exe\r\nD:\\Tools\\Sysinternals\\AccessEnum.exe\r\nD:\\Tools\\Sysinternals\\Procexp.exe<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>D:\\Tools\\Sysinternals\\accesschk.exe (your word or phrase here)\r\nD:\\Tools\\Sysinternals\\AccessEnum.exe (your word or phrase here)\r\nD:\\Tools\\Sysinternals\\Procexp.exe (your word or phrase here)<\/pre>\n<hr \/>\n<h3><a id=\"remove_duplicate_rows_without_sorting\"><\/a>Remove duplicate rows in a text file using Notepad++ without sorting the lines<\/h3>\n<p>To remove duplicate rows in a text file using Notepad++ <strong>without sorting<\/strong> the rows, use this search and replace operator:<\/p>\n<ol>\n<li>Find what: <code>^(.*?)$\\s+?^(?=.*^\\1$)<\/code><\/li>\n<li>Replace with: Leave blank<\/li>\n<li>Set the Search mode to <strong>Regular expression<\/strong><\/li>\n<li><strong>*<\/strong>Enable<strong>*<\/strong> <strong>matches newline<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p>This removes all the duplicate lines leaving out the original. As a bonus, it also removes <a href=\"#delete_blank_lines\">blank lines<\/a> automatically.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9893\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/notepad-plus-remove-duplicate-rows-without-sort.gif\" alt=\"notepad++ tips - remove duplicate rows without sorting\" width=\"692\" height=\"503\" \/><\/p>\n<p><em><strong>Important:<\/strong> You must enable <strong>matches newline<\/strong> for this to work. Credits to <a href=\"https:\/\/stackoverflow.com\/a\/16293580\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">stema<\/a><\/em><\/p>\n<p>The above is a brilliant method that doesn&#8217;t need sorting of the lines. The duplicate rows can be located anywhere in the text file and they&#8217;re not reordered.<\/p>\n<p><strong>::Before::<\/strong><\/p>\n<pre>12345\r\n23456\r\n34567\r\n45678\r\n\r\n12345\r\n23456\r\n34567\r\n45678\r\n\r\n12345\r\n23456\r\n34567\r\n45678<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>12345\r\n23456\r\n34567\r\n45678<\/pre>\n<h4>Remove consecutive duplicate lines<\/h4>\n<p>If the duplicate rows are located immediately after each other, to remove the <strong>consecutive<\/strong> duplicate rows, from the <strong>Edit<\/strong> menu in Notepad++, click <strong>Line Operations<\/strong>, and select <strong>Remove Consecutive Duplicate Lines<\/strong><\/p>\n<p><strong>::Before::<\/strong><\/p>\n<pre>12345\r\n12345\r\n12345\r\n23456\r\n23456\r\n34567\r\n34567\r\n45678\r\n45678<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>12345\r\n23456\r\n34567\r\n45678<\/pre>\n<hr \/>\n<h3><a id=\"newline_at_a_character\"><\/a>Insert new line (carriage return) at a specific character or string<\/h3>\n<p>To insert a new line (carriage return) after at a specific character or string &#8212; e.g., after a Comma, use this search and replace operator:<\/p>\n<ol>\n<li>Find what: <code>,<\/code><\/li>\n<li>Replace with: <code>\\r\\n<\/code><\/li>\n<li>Set the Search mode to <strong>Extended<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p>The above search &amp; replace operation adds a new line wherever the comma appears.<\/p>\n<p><strong>::Before::<\/strong><\/p>\n<pre>Cecilia Chapman,711-2880 Nulla St.,Mankato Mississippi 96522,(257) 563-7401,Iris Watson,P.O. Box 283 8562 Fusce Rd.<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>Cecilia Chapman\r\n711-2880 Nulla St.\r\nMankato Mississippi 96522\r\n(257) 563-7401\r\nIris Watson\r\nP.O. Box 283 8562 Fusce Rd.<\/pre>\n<p>If you want to retain the trailing comma after every line, use <code>,\\r\\n<\/code> in the Replace with: text box.<\/p>\n<h4>Example 2:<\/h4>\n<p>To insert a new line at a specific string ( named <code>GUID:<\/code>), use this example:<\/p>\n<ol>\n<li>Find what: <code>\u00a0GUID:<\/code><\/li>\n<li>Replace with: <code>\\r\\n<\/code><\/li>\n<li>Set the Search mode to <strong>Extended<\/strong><\/li>\n<li>Click Replace All<\/li>\n<\/ol>\n<p><strong>::Before::<\/strong><\/p>\n<pre>Documents GUID:{D3162B92-9365-467A-956B-92703ACA08AF}\r\n\r\nDownloads GUID:{088E3905-0323-4B02-9826-5D99428E115F}\r\n\r\nMusic GUID:{3DFDF296-DBEC-4FB4-81D1-6A3438BCF4DE}\r\n\r\nPictures GUID:{24AD3AD4-A569-4530-98E1-AB02F9417AA8}\r\n\r\nVideos GUID:{F86FA3AB-70D2-4FC7-9C99-FCBF05467F3A}<\/pre>\n<p><strong>::After::<\/strong><\/p>\n<pre>Documents \r\nGUID:{D3162B92-9365-467A-956B-92703ACA08AF}\r\n\r\nDownloads\r\nGUID:{088E3905-0323-4B02-9826-5D99428E115F}\r\n\r\nMusic\r\nGUID:{3DFDF296-DBEC-4FB4-81D1-6A3438BCF4DE}\r\n\r\nPictures\r\nGUID:{24AD3AD4-A569-4530-98E1-AB02F9417AA8}\r\n\r\nVideos\r\nGUID:{F86FA3AB-70D2-4FC7-9C99-FCBF05467F3A}<\/pre>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>Notepad++ is an excellent light-weight text editor with many useful features. With Notepad++, you can find and replace text in the current file or in multiple files in a folder recursively. You can also find and replace text using regex. This post has many Notepad++ find &amp; replace examples and other useful Notepad++ tips for &#8230; <a title=\"Notepad++ Tips: Find and Replace, and Text Manipulation Examples\" class=\"read-more\" href=\"https:\/\/www.winhelponline.com\/blog\/notepad-plus-find-and-replace-text\/\" aria-label=\"Read more about Notepad++ Tips: Find and Replace, and Text Manipulation Examples\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[6],"tags":[339],"class_list":["post-9886","post","type-post","status-publish","format-standard","hentry","category-utilities","tag-notepad"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10337,"url":"https:\/\/www.winhelponline.com\/blog\/flip-or-reverse-text-file-contents-windows\/","url_meta":{"origin":9886,"position":0},"title":"How to Flip or Reverse a Text File Using Different Ways in Windows","author":"Ramesh","date":"July 14, 2019","format":false,"excerpt":"When analyzing plain-text log files such as the Web server logs or the Sfc, or DISM log files, you may sometimes prefer the most recent items appearing at the top. However, most of the log files that Windows generates would have the oldest entries listed first -- entries listed in\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"reverse lines in a text file notepad++","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/reverse-text-file-notepad-plus-5.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/reverse-text-file-notepad-plus-5.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/reverse-text-file-notepad-plus-5.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":8728,"url":"https:\/\/www.winhelponline.com\/blog\/remove-lines-containing-word-string-text-file\/","url_meta":{"origin":9886,"position":1},"title":"How to Remove Lines Containing a Word or String in a Text File","author":"Ramesh","date":"April 19, 2019","format":false,"excerpt":"If you have hundreds of lines in a text file and want to bulk delete lines that contain a word or string, this article is for you. Let's use the excellent third-party text editor Notepad++ (free) for deleting lines containing a word in a text-based file, using different methods. Remove\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"remove lines not containing a word notepad++ regex","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/remove-lines-not-containing-word-regex-notepad-plus.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/remove-lines-not-containing-word-regex-notepad-plus.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/remove-lines-not-containing-word-regex-notepad-plus.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":5732,"url":"https:\/\/www.winhelponline.com\/blog\/replace-notepad-text-editor-notepad-plus-association\/","url_meta":{"origin":9886,"position":2},"title":"How to Replace Notepad With Notepad++ or Other Editor","author":"Ramesh","date":"November 2, 2017","format":false,"excerpt":"If you\u2019re looking at how to replace Notepad with Notepad++ or any third-party editor, this post explains how to do it. Notepad++ is a free source code editor and Notepad replacement that supports several languages. Let\u2019s see how you can replace Notepad with Notepad++ without replacing any system files. Notepad\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"notepad plus replace debugger notepad.exe","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8738,"url":"https:\/\/www.winhelponline.com\/blog\/open-with-notepad-plus-right-click-menu-windows\/","url_meta":{"origin":9886,"position":3},"title":"Add &#8220;Open with Notepad++&#8221; to the Right-Click Menu","author":"Ramesh","date":"April 19, 2019","format":false,"excerpt":"Many users have replaced Notepad with Notepad++ as the default text editor on their computers. Others use Notepad++ only when needed, and launch it via the Open with menu and choose Notepad++ from the list of options. This post tells you how to add the Open with Notepad++ command to\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"Notepad++ right-click menu in Windows","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":213,"url":"https:\/\/www.winhelponline.com\/blog\/add-the-open-with-notepad-context-menu-option-for-all-file-types\/","url_meta":{"origin":9886,"position":4},"title":"Add &#8220;Open with Notepad&#8221; to the Right-click Menu for all file types","author":"Ramesh","date":"April 24, 2008","format":false,"excerpt":"There are situations where you need to open plain-text files having an unknown or unregistered file extension using Notepad. By default, no file association exists for extension-less files and files with unknown extension in Windows. So, to open those files, you use the Open With option and select Notepad from\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"add open with notepad to right-click","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/04\/open_with_notepad.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/04\/open_with_notepad.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/04\/open_with_notepad.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":76004,"url":"https:\/\/www.winhelponline.com\/blog\/remove-non-numeric-chars-file-name\/","url_meta":{"origin":9886,"position":5},"title":"How to remove all non-numeric characters from filename","author":"Ramesh","date":"July 18, 2024","format":false,"excerpt":"One of our readers asked how to remove non-numeric characters from file names using the Microsoft PowerToys PowerRename tool. You can accomplish the task using regex. Those who don't have Microsoft PowerToys installed, download it from Install PowerToys | Microsoft Learn. Remove text (non-numbers) from the file name Method 1\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"powerrename non-numbers from file names","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/9886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=9886"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/9886\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=9886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=9886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=9886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}