Here’s how to use name() function.
Description:
Return a file’s path relative to the main directory.
Syntax:
f.name()
Note:
The function returns file f’s path relative to the main directory; return the full path if f isn’t in the main directory.
Parameter:
f |
A file |
Optios:
@p |
Return a full path |
Return value:
String
Example:
|
A |
|
1 |
=file("G:/Program files/raqsoft/esProc/demo/data/data.txt").name() |
Return the path which is relative to the main directory because the file is under the main directory: G:/Program files/raqsoft/esProc/demo. |
2 |
=file("E:/Program files/raqsoft/esProc/data/data.txt").name() |
Return the full path when the file isn’t in the main directory. |
3 |
=file("employee1.txt").name@p() |
Return the full path since employee1.txt is in the main directory. |