(no subject)
Aug. 13th, 2007 08:42 pmReason for keeping good backups #35:
For when your renaming script runs amok and attempts to rename the files it just renamed. Not a particularly common reason for needing backups, but saves me having to work out how to make exiftool work.
In other news, cmd.exe apparently rescans the directory on each iteration of a for loop, such that it will iterate over new files. This can be useful, but not when the point of the loop is to rename files without moving them.
For when your renaming script runs amok and attempts to rename the files it just renamed. Not a particularly common reason for needing backups, but saves me having to work out how to make exiftool work.
In other news, cmd.exe apparently rescans the directory on each iteration of a for loop, such that it will iterate over new files. This can be useful, but not when the point of the loop is to rename files without moving them.
no subject
Date: 2007-08-14 10:30 am (UTC)FOR /F "usebackq" %a in (`dir /b /a-d`) DO
to the rescue as usual, I take it?
no subject
Date: 2007-08-14 11:08 am (UTC)The full command was:
@for /d %I in (????) do @for /d %J in (%I\??) DO @for %K in (%J\*.jpg) do @(set foo=%~nK&& if not !foo:~0^,1!==K ( ( if !foo:~4^,2!==10 ( set bar=A) else ( if !foo:~4^,2!==11 ( set bar=B) else ( if !foo:~4^,2!==12 ( set bar=C) else ( set bar=!foo:~5,1!) ) ) ) && echo %K K!bar!!foo:~6,2!!foo:~20,4!.JPG && ren %K K!bar!!foo:~6,2!!foo:~20,4!.JPG ) )
It was used for bulk renaminmg of photos, as the default naming format from Kodak's software is pretty useless. I'd used exiftool previously to shift the metadata into the filename, but wanted to do some more formatting.
On a related note, do you know of a win32 touch equivalent that actually sets the creation datetime? All I've seen only handles modification datetime, and sometimes access datetime.
no subject
Date: 2007-08-15 10:11 am (UTC)However FileTouch 2 (freeware, command line/GUI) might be more useful to you. It has a couple of features geared towards handling camera pics, and appears to be quite configurable.