Use regular expressions to batch delete the date at the beginning of file names
Translationļ¼EnglishFranƧaisDeutschEspaƱolę„ę¬čŖķźµģ“ļ¼Updated onļ¼2025-06-03 16:16
When handling various files, we often encounter file names mixed with various dates, such as 2024-01-01_XXX.docx, 2025-02-02_XXX.xlsx, etc. As time goes on, the number of files stored on the computer increases, leading to chaos and making it particularly difficult to find the required files. At this time, we can use regular expressions to quickly and batch delete the cumbersome date content at the beginning of file names, leaving only the specific content. Using regular expressions to batch remove the year, month, and day from file names is applicable in multiple scenarios. For example, when organizing old files, removing unnecessary dates allows us to quickly match file types; when preparing a new batch of files, removing the old dates from template file names allows us to reuse the files directly; when a team project reaches a stage where unified file naming is required, the first step is to delete the dates at the beginning of file names. In the above scenarios, reasonable use of regular expressions can quickly batch delete the dates at the beginning of all file names with one click, avoiding manual deletion of files one by one, and significantly improving work efficiency. So how should we use regular expressions to batch delete the year, month, and day content at the beginning of a large number of file names?
1ćUsage Scenarios
When organizing old files, many files with dates have expired, and keeping them can affect the search for other files. At this time, we can use regular expressions to quickly batch remove the date at the beginning of file names to improve our work efficiency.
2ćPreview
Before Processingļ¼
After Processingļ¼
3ćOperation Steps
Open ćHeSoft Doc Batch Toolć, select ćFile Nameć - ćFind and Replace Keywords in File Namesć.
ćAdd Fileć Independently add files that need to have the starting date removed from the file names.
ćImport Files from Folderć Import all files from the selected folder.
Below, you can view the imported files.
ćSearch Methodć Click to use formula fuzzy text search.
ćKeyword List to Findć Enter the regular expression as shown in the figure below. \d{4} represents the year, and the following two consecutive \d{2} represent the month and day.
ćKeyword List to Replaceć Leave blank to indicate deletion.
After processing is complete, click the red path behind the save location to view the files with deletion completed.
Keywordļ¼Batch delete year , month , day from file names , how to batch delete text from file names , how to delete dates from file names