Skip to content

Instantly share code, notes, and snippets.

@cbillowes
Last active April 22, 2018 16:07
Show Gist options
  • Save cbillowes/dd2e613973a62355946f82609455b6b3 to your computer and use it in GitHub Desktop.
Save cbillowes/dd2e613973a62355946f82609455b6b3 to your computer and use it in GitHub Desktop.
Scrapbook

.bat to iterate through files and extract the first 10 characters from its name.

setlocal ENABLEDELAYEDEXPANSION

for %%f in (posts/*) do (
    set var=%%f
    @echo %var:~0,10%
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment