-
-
Save shakir-abdo/0f42594fbccdef53dddcadfc34670956 to your computer and use it in GitHub Desktop.
This script generates .txt caption files from .jpg file names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
for %%i in (*.jpg) do ( | |
set filename=%%i | |
set caption_filename=%%~ni.txt | |
set caption=%%~ni | |
setlocal EnableDelayedExpansion | |
for /f "tokens=1 delims=()" %%a in ("!caption!") do ( | |
set caption=%%a | |
) | |
for /f "tokens=* delims=0123456789()" %%b in ("!caption!") do ( | |
set caption=%%b | |
) | |
echo !caption! > %%~ni.txt | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment