$fname (parse-spec) function
The filename portion of the pathname given by parse-spec is returned. (The parse-spec returns a standard pathname with either a backslash or forward slash characters.) This can be used to strip the path name, or ignore the path name component of a full pathname to a file.
Target string | Parse expression | Return value |
|---|---|---|
File installationDirectory\X.txt | $fname(file *) | X.txt |
F1: /susr/pass.x | $fname(f1: *) | Pass.x |
Test - P: /x y z/aaa.exe - EOM | $fname( $delim(spdash, p: *)) | aaa.exe |
C:\x\y\zzz.xls | $suffix( $fname($1)) | xls |
C:\x\y\zzz.xls
| $basename( $fname($1)) | Zzz |
Related topic
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*