How I could extract the folder name that precedes de file name?
I have a different files inside folder and subfolder.
I want to extract those name.
PS: It could be : one , two…four indentation of subfolder.
PS: The name of the folders does not have a rule, it can be any name.
Is there a way?
Maybe the solution would be to count how many “/” and backwards capture the name that is between the penultimate and last “/”. But I don’t know how to do it.