This awk
may be what you need.
awk '/Drive\/Music/ {sub(/\/string/,":string");sub(/Music.*\//,"Music/");sub(/:string/,"/string")}1' file
It will change this type of lines:
<key>Location</key><string>file://localhost/Volumes/External%20Hard%20Drive/Music/Adele/21/RollingInTheDeep.m4a</string>
<key>Location</key><string>file://localhost/Volumes/External%20Hard%20Drive/Music/Adele/SomeoneLikeYou.mp3</string>
to
<key>Location</key><string>file://localhost/Volumes/External%20Hard%20Drive/Music/RollingInTheDeep.m4a</string>
<key>Location</key><string>file://localhost/Volumes/External%20Hard%20Drive/Music/SomeoneLikeYou.mp3</string>
How does this work:
awk '
/Drive\/Music/ { # Serch for all lines with Drive/Music lines
sub(/\/string/,":string") # Replace last / to prevent problem with greedy regex in next step
sub(/Music.*\//,"Music/") # Replace from Music to last / with only Music/ (using .* greedy)
sub(/:string/,"/string") # Replace last / back to its original
}
1 # Print all lines, changed and not changed
' file # input file