{"id":76004,"date":"2024-07-18T13:24:24","date_gmt":"2024-07-18T07:54:24","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=76004"},"modified":"2024-07-18T13:25:43","modified_gmt":"2024-07-18T07:55:43","slug":"remove-non-numeric-chars-file-name","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/remove-non-numeric-chars-file-name\/","title":{"rendered":"How to remove all non-numeric characters from filename"},"content":{"rendered":"<p>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.<!--more--><\/p>\n<p><em>Those who don&#8217;t have Microsoft PowerToys installed, download it from <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/powertoys\/install\" rel=\"noopener\" target=\"_blank\">Install PowerToys | Microsoft Learn<\/a>.<\/em><\/p>\n<h2>Remove text (non-numbers) from the file name<\/h2>\n<h3>Method 1<\/h3>\n<p>This method also removes spaces within the file name.<\/p>\n<ul>\n<li>Multi-select the files, right-click, and click PowerRename.<\/li>\n<li>Use the following regex:\n<pre><strong>[A-Z a-z]<\/strong><\/pre>\n<\/li>\n<li>Enable &#8220;Use regular expressions.&#8221;<\/li>\n<li>Enable &#8220;Match all occurrences.&#8221;<\/li>\n<li>Apply to &#8220;Filename only.&#8221;<\/li>\n<\/ul>\n<p>As stated earlier, this also removes all the space (not just the leading and trailing spaces) in the file name.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-76007\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-1.png\" alt=\"powerrename non-numbers from file names\" width=\"805\" height=\"540\" srcset=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-1.png 805w, https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-1-768x515.png 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/p>\n<p>If you don&#8217;t want to remove the spaces, use Method 2 below.<\/p>\n<hr \/>\n<h3>Method 2<\/h3>\n<p>This method doesn&#8217;t remove the whitespaces within the file names, but it does remove the trailing whitespace(s).<\/p>\n<p>In this method, we rename the files in two passes. In the first pass, we remove the non-numeric characters, and in the second pass, we remove the trailing whitespace(s), if any, in the file name.<\/p>\n<ol>\n<li>Multi-select the files, right-click and click PowerRename.<\/li>\n<li>First, use this regex:\n<pre><strong>[A-Za-z]<\/strong><\/pre>\n<\/li>\n<li>Enable &#8220;Use regular expressions.&#8221;<\/li>\n<li>Enable &#8220;Match all occurrences.&#8221;<\/li>\n<li>Apply to &#8220;Filename only.&#8221;\n<div class=\"newline\">After renaming the files, they will look like the ones below\u2014i.e., the file names have a <strong>trailing white space<\/strong> before the dot.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-76006\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-2.png\" alt=\"powerrename non-numbers from file names\" width=\"806\" height=\"536\" srcset=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-2.png 806w, https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-2-768x511.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/div>\n<\/li>\n<li><strong>Next<\/strong>, use the following regex to remove one or more trailing spaces, if any, in the file name:\n<pre><strong>( *)$<\/strong><\/pre>\n<\/li>\n<li>Enable &#8220;Use regular expressions.&#8221;<\/li>\n<li>Enable &#8220;Match all occurrences.&#8221;<\/li>\n<li>Apply to &#8220;Filename only.&#8221;<\/li>\n<\/ol>\n<p>Here&#8217;s what the final output looks like\u2014i.e., the trailing white space has been removed.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-76005\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-3.png\" alt=\"powerrename non-numbers from file names\" width=\"806\" height=\"535\" srcset=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-3.png 806w, https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/powerrename-remove-non-numbers-3-768x510.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<p>That&#8217;s it!<\/p>\n<hr \/>\n<div class=\"rp\"><strong>RELATED:<\/strong> <a href=\"https:\/\/www.winhelponline.com\/blog\/notepad-plus-find-and-replace-text\/\">Notepad++ Tips: Find and Replace, and Text Manipulation Examples<\/a><\/div>\n<p>Also, see Bulk Rename Utility, which has more features than PowerToys PowerRename.<br \/>\nhttps:\/\/www.bulkrenameutility.co.uk\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[7],"tags":[974,871],"class_list":["post-76004","post","type-post","status-publish","format-standard","hentry","category-windows","tag-powerrename","tag-powertoys"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":309,"url":"https:\/\/www.winhelponline.com\/blog\/enable-or-disable-thumbnail-preview-for-pdf-files\/","url_meta":{"origin":76004,"position":0},"title":"[Fix] PDF Thumbnail and Preview Not Showing Up in File Explorer","author":"Ramesh","date":"May 29, 2008","format":false,"excerpt":"In your Windows computer, File Explorer may not display PDF thumbnails, and instead, show only the default icon assigned for PDF files. This might happen even if you have the option Always show icons, never thumbnails unchecked in the View tab of the Folder Options dialog. Also, in Microsoft Outlook\u2026","rel":"","context":"In &quot;Microsoft Edge&quot;","block_context":{"text":"Microsoft Edge","link":"https:\/\/www.winhelponline.com\/blog\/category\/edge\/"},"img":{"alt_text":"Edge PDF Preview Handler - Microsoft PDF Previewer","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/edge-preview-handler.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/edge-preview-handler.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/edge-preview-handler.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/edge-preview-handler.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":27947,"url":"https:\/\/www.winhelponline.com\/blog\/cant-rename-files-upper-lowercase-usb-drives\/","url_meta":{"origin":76004,"position":1},"title":"Why Can&#8217;t I Rename Files to Upper or Lowercase on USB Drives","author":"Ramesh","date":"September 3, 2022","format":false,"excerpt":"Here's a user query where they're unable to change the file name extension to lowercase from uppercase (or the other way) on external drives. For instance, the command-line to bulk change the extension (ren *.WAV\u00a0 *.wav) may work on the system drive but not on an external drive. Query: My\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"usb flash drive","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2018\/09\/usb-flash-disk.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":804,"url":"https:\/\/www.winhelponline.com\/blog\/image-resizer-powertoy-context-menu\/","url_meta":{"origin":76004,"position":2},"title":"How to Resize Images via the Right-click menu in Windows 10","author":"Ramesh","date":"January 5, 2009","format":false,"excerpt":"Recently, I stumbled upon an excellent tool to resize images via the right-click menu in Windows. It's the Image Resizer utility written by Brice Lambson. This utility is similar to Microsoft's Image Resizer PowerToy for Windows XP. And Brice Lambson's utility works fine in all versions of Windows, including Windows\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"powertoys settings page","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2009\/01\/powertoys-settings-page-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2009\/01\/powertoys-settings-page-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2009\/01\/powertoys-settings-page-2.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":26634,"url":"https:\/\/www.winhelponline.com\/blog\/pdf-preview-directory-index-file-not-found\/","url_meta":{"origin":76004,"position":3},"title":"[Fix] PDF Preview Shows Directory Index or ERR_FILE_NOT_FOUND","author":"Ramesh","date":"April 29, 2022","format":false,"excerpt":"When you preview PDF files in File Explorer or Microsoft Outlook on your Windows 10 or Windows 11 computer, the preview pane may show the directory index of the current folder instead of previewing the PDF file's contents. In some cases, it shows the following error: File not found It\u2026","rel":"","context":"In &quot;Microsoft Edge&quot;","block_context":{"text":"Microsoft Edge","link":"https:\/\/www.winhelponline.com\/blog\/category\/edge\/"},"img":{"alt_text":"enablepreviewhandler - edge pdf preview registry value","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/04\/pdf-enablepreviewhandler-registry.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/04\/pdf-enablepreviewhandler-registry.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/04\/pdf-enablepreviewhandler-registry.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/04\/pdf-enablepreviewhandler-registry.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":25600,"url":"https:\/\/www.winhelponline.com\/blog\/outlook-cant-preview-pdf-attachments\/","url_meta":{"origin":76004,"position":4},"title":"[Fix] Microsoft Outlook Cannot Preview PDF Attachments","author":"Ramesh","date":"January 8, 2022","format":false,"excerpt":"Microsoft Outlook has attachment preview support wherein you can preview the file attachments without having to open the respective program. For this, Outlook utilizes the existing preview handler modules added by individual programs. This article describes the various type of PDF attachment preview issues that users face in Microsoft Outlook\/Outlook\u2026","rel":"","context":"In &quot;Office&quot;","block_context":{"text":"Office","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/office\/"},"img":{"alt_text":"outlook pdf preview not working - preview handlers","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/01\/outlook-pdf-preview-error-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/01\/outlook-pdf-preview-error-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/01\/outlook-pdf-preview-error-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/01\/outlook-pdf-preview-error-2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8728,"url":"https:\/\/www.winhelponline.com\/blog\/remove-lines-containing-word-string-text-file\/","url_meta":{"origin":76004,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/76004","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=76004"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/76004\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=76004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=76004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=76004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}