Hi people,
can somebody tells me how can I extract the file name from a variable full path (path + filename)?
Sample:
set fullpathinfo "/aaa/.../bbb/ccc/filename1.txt"
set filenameresult ""
[unknow code here to extract only filename1.txt and put it into variable filenameresult]
[...]
puts $filenameresult
% filename1
Basically I need some rule that searches untill the last "/" in the input "fullpathinfo" variable and then extract the remaining string. (we cannot rely on a fixed pathname - they can vary)
Can anybody help me please? Thanks
can somebody tells me how can I extract the file name from a variable full path (path + filename)?
Sample:
set fullpathinfo "/aaa/.../bbb/ccc/filename1.txt"
set filenameresult ""
[unknow code here to extract only filename1.txt and put it into variable filenameresult]
[...]
puts $filenameresult
% filename1
Basically I need some rule that searches untill the last "/" in the input "fullpathinfo" variable and then extract the remaining string. (we cannot rely on a fixed pathname - they can vary)
Can anybody help me please? Thanks