I have the following link:
'//mypath/link1/link2/link3/link4/this is the folder\\123456 (2).txt'
I would like to extract the path+sub directory separately, filename with extension and filename without extension. The output should look like the following:
[//mypath/link1/link2/link3/link4/this is the folder, 123456 (2).txt, 123456]
What I tried so far?
import os
pth = '//mypath/link1/link2/link3/link4/this is the folder\\123456 (2).txt'
head, tail = os.path.split(pth)
print([head, tail])
I was able to extract the path and filename but not the filename without extension. How do I do that?