Get the folder name from the path

Started by irinaonline, October 24, 2024, 02:38:45 PM

Previous topic - Next topic

irinaonline

I am trying to get the folder name, not the whole path. This is my current version:

%EXIFTOOL% -r -if "$datetimeoriginal gt '%DATEFROM%'" -if "$datetimeoriginal lt '%DATEUNTIL%'" -gpslatitude# -gpslongitude# -datetimeoriginal -directory -p "<Placemark><name>${directory}</name><TimeStamp><when>$datetimeoriginal</when></TimeStamp><Point><coordinates>$gpslongitude#,$gpslatitude#,0</coordinates></Point></Placemark>" "%DIR1%" "%DIR2%" >> "%OUTPUT%"

what needs to be changed fo ${directory}?

Phil Harvey

Change ${directory} to ${directory;s(.*/)()}

This substitution expression will remove everything up to and including the last "/" in the path name.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

irinaonline