0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

パワポ関連の小ネタ:「すべてのスライドを保存」で書き出した画像のファイル名を黒い画面を使って一括で変更(数字の2桁化も)【Win/Mac】

0
Posted at

はじめに

以下の、パワポでの「すべてのスライドを保存」を使って書き出した画像の、ファイル名のリネームに関する小ネタです。

2026-06-07_10-00-03.jpg

今回の内容

通常、書き出しをすると、以下のようなファイル名になります(画像のファイル形式は PNG指定の場合)。

2026-06-07_09-58-17.jpg

ファイル名の変更

これを、以下のような英語名にして、なおかつ数字の部分にゼロパディングをして 2桁固定にする(1桁の場合は、2桁目を 0 にする)というのをやった時のメモです。

Mac の場合

2026-06-07_09-58-35.jpg

Windows の場合

2026-06-09_00-01-16.jpg

リネーム用の処理

Mac での処理

Mac では、zsh で以下を実行して対応しました。

for f in スライド<->.png; do
  n=${${f#スライド}%.png}
  mv -- "$f" "image$(printf '%02d' $n).png"
done

Windows での処理

以下は、Windows で PowerShell を使った場合の内容です。

Get-ChildItem スライド*.png | ForEach-Object {
    $n = [int]($_.BaseName -replace 'スライド','')
    Rename-Item $_.FullName ("image{0:D2}.png" -f $n)
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?