filename()

Read(3338) Label: split up, full path, get file name, suffix,

Description:

Split up the full path and get the file name and extension.

Syntax:

filename(fn)

Note:

The function splits the file name and extension from the full path fn.

Parameter:

fn

The full path with the file name

Option:

@e

Only split the extension part from the full path

@n

Split out the file name without the extension

@d

Split out the directory under which the file is located, inclusive of address string

@p

Add the main path before the file name of the non-absolute path. Return the main path directly if fn is ""; if the main directory is empty, make the query according to the rules defined in sectionUser reference – Main directroyand return result

Example:

 

A

 

1

=filename("D://file/test.dfx")

Output “test.dfx” .

2

=filename@e("D://file/test.dfx")

Output “dfx”.

3

=filename@n("D://file/test.dfx")

Output “test”.

4

=filename@d("D://file/test.dfx")

Output “D://file”.

5

=filename@p("p2.txt")

Output

“D:\Program Files\raqsoft\esProc\demo\p2.txt”.

6

=filename@p("")

Output the main directory

“D:\Program Files\raqsoft\esProc\demo”.

Related functions:

file()