This is running from a batch file in Windows.
exiftool.exe -api filter="s/ \(approx\)//" -AudioBitrate -FileName -Directory -Comment -Artist -Title -Album -Duration -j -r -ext mp3 -ext flac -progress "C:\Audio" >>"MusicSearch temp.js"
This is all working great.
At the moment -Directory is returning a full path as it should eg: C:/Audio/Artist/Album....
I need to loose the C:/Audio/ part, so that I end up with Artist/Album...
Is this possible?
Also not so important, but I would like to change each "/" to " - "
Any help is greatly apprieciated
I am not understanding 100%...
The regex should be simple enough
/^C:\/Audio\///
;s/^C:\/Audio\///
However I doubt that the syntax is correct...
Similar for the forward slashes to hyphens:
/\//-/g
However again, what I am not understanding probably invalidates what I just wrote!
Looking forward to see what the answer really is!
You pretty much have it, Stephen, though I probably would use tr/\//-/ instead, not that savings would be that measurable.
The question is whether replacing slashes is going to have an affect on any of the other tags. For example, AC/DC would become AC-DC and Love Without Tragedy / Mother Mary by Rihanna would become Love Without Tragedy - Mother Mary. This could be solved using the hashtag # option of the -n option (https://exiftool.org/exiftool_pod.html#n---printConv)
So, I'd say try this out and see if it needs refining:
exiftool.exe -api filter="s/ \(approx\)//;s/^C:\/Audio\///;tr/\//-/" -AudioBitrate -FileName -Directory -Comment# -Artist# -Title# -Album# -Duration -j -r -ext mp3 -ext flac -progress "C:\Audio" >>"MusicSearch temp.js"
Thanks StarGeek! As I said, the syntax would have killed me – not the regex itself so much, but tying the regex it into the full command. I thought that one would need to link the regex directly to the Directory tag, rather than in the expression before the tags.
Thank you for your time guys. Thank you StarGeek that works great, I'm gonna have to learn regex I think :)