You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

批量移动后缀序号/随机ID(图片、JPEG、RAW等文件适用)

Got it, let's sort out this batch file renaming task for your images. I'll cover command-line solutions (perfect for large batches) and a GUI option if you prefer clicking over typing.

Windows (PowerShell)

PowerShell comes built-in with Windows, so no extra software needed. Here's how to do it:

  1. Open PowerShell and navigate to your image folder (use cd C:\Path\To\Your\Images).
  2. Run this command to preview changes first (add -WhatIf to avoid actually renaming):
Get-ChildItem -Filter "*.jpg","*.raw","*.png" | Rename-Item -NewName {
    $_.Name -replace '^(.*)_©_Hello_World_([A-Za-z0-9]+)\.([a-zA-Z0-9]+)$', '$1_$2_©_Hello_World.$3'
} -WhatIf
  1. If the preview looks correct, remove -WhatIf to apply the renaming.

Breakdown:

  • Get-ChildItem grabs all files matching your specified formats (add more like *.tif if needed).
  • The regex ^(.*)_©_Hello_World_([A-Za-z0-9]+)\.([a-zA-Z0-9]+)$ captures three parts:
    • $1: The main prefix of the filename (e.g., Australia_Brisbane_NP)
    • $2: The random ID/number at the end (e.g., 1163, AHDFGF)
    • $3: The file extension (e.g., jpg, raw)
  • We rearrange these parts into the desired format: $1_$2_©_Hello_World.$3

macOS/Linux (Bash)

Most Unix-like systems use the rename command (note: Debian/Ubuntu uses prename, which is Perl-based, while macOS uses a simpler built-in version—both work here):

  1. Open Terminal and navigate to your image folder (cd /Path/To/Your/Images).
  2. Preview changes first by running:
# Debian/Ubuntu
prename -n 's/^(.*)_©_Hello_World_([A-Za-z0-9]+)\.([a-zA-Z0-9]+)$/$1_$2_©_Hello_World.$3/' *.{jpg,raw,png}

# macOS
rename -n 's/^(.*)_©_Hello_World_([A-Za-z0-9]+)\.([a-zA-Z0-9]+)$/$1_$2_©_Hello_World.$3/' *.{jpg,raw,png}
  1. Remove the -n flag to apply the renaming once you're happy with the preview.

Breakdown:

  • The *.{jpg,raw,png} glob matches all files with those extensions (add more as needed).
  • The regex substitution works exactly like the PowerShell version—capturing the three parts and rearranging them.

GUI Alternative (Cross-Platform)

If you'd rather use a visual tool, XnConvert (free, cross-platform) is great for batch renaming with regex:

  1. Download and open XnConvert.
  2. Click "Add files" or drag-and-drop all your images into the app.
  3. Go to the Actions tab, then click "Add action" > "Rename".
  4. In the "Rename" settings:
    • Set "Method" to "Regular expression".
    • In "Pattern", enter: ^(.*)_©_Hello_World_([A-Za-z0-9]+)\.([a-zA-Z0-9]+)$
    • In "Replace with", enter: $1_$2_©_Hello_World.$3
  5. Click "Preview" to check the new filenames, then click "Convert" to apply the changes.

Pro Tip:

Always preview changes first! Command-line tools have preview flags (-WhatIf in PowerShell, -n in rename), and GUI tools let you check before applying—this avoids accidental mistakes with your files.

内容的提问来源于stack exchange,提问作者Emmanuel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 12:13:31