Difference between revisions of "FilePathPart"
(Corrections to examples EW 20133) |
|||
Line 7: | Line 7: | ||
«part» can be one of: | «part» can be one of: | ||
− | * <code>'folder'</code> | + | * <code>'folder'</code>: FilePathPart( filepath, 'folder' ) returns the folder part of «filepath», for example: |
− | + | ** FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'folder') → "C:\DataFeeds\ISO" | |
− | * | + | ** FilePathPart("C:\DataFeeds\ISO\", 'folder') → "C:\DataFeeds\ISO") |
− | * | ||
− | * | ||
− | * | ||
− | + | * <code>'filename'</code>: FilePathPart( filepath, 'filename' ) returns just the filename, "" for a directory. For example: | |
− | + | ** FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'filename') → "HourlyToday.csv" | |
− | + | ** FilePathPart("C:\DataFeeds\ISO\", 'filename') → "" | |
− | |||
− | |||
− | FilePathPart( filepath, 'filename' ) returns just the filename, "" for a directory. | ||
− | |||
− | |||
− | |||
− | FilePathPart( filepath, 'name' ) returns the file or folder name | + | * <code>'name'</code>: FilePathPart( filepath, 'name' ) returns the file or folder name, for example: |
− | + | ** FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'name') → "HourlyToday.csv" | |
− | + | ** FilePathPart("C:\DataFeeds\ISO\", 'name') → "ISO" | |
− | FilePathPart( filepath, 'filename only' ) returns the filename without an extension | + | * <code>'filename only'</code>: FilePathPart( filepath, 'filename only' ) returns the filename without an extension |
− | + | ** FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'filename only') → "HourlyToday" | |
− | + | * <code>'extension'</code>: FilePathPart( filepath, 'extension' ) returns the lowercase file extension. Is "" for a file without | |
− | FilePathPart( filepath, 'extension' ) returns the lowercase file extension. Is "" for a file without | ||
an extension, or null for a folder. | an extension, or null for a folder. | ||
− | + | ** FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'extension') → "csv" | |
− | + | ** FilePathPart("C:\DataFeeds\ISO\", 'extension') → "" | |
− | FilePartPart( filepath, 'parent' ) returns the parent folder which is different from 'folder, in the case of a directory. | + | * <code>'parent'</code>: FilePartPart( filepath, 'parent' ) returns the parent folder which is different from 'folder, in the case of a directory. For example: |
− | + | ** FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'parent') → "C:\DataFeeds\ISO" | |
− | + | ** FilePathPart("C:\DataFeeds\ISO\", 'parent') → "C:\DataFeeds") | |
== See Also == | == See Also == | ||
* [[:category:File system functions|File system functions]] | * [[:category:File system functions|File system functions]] | ||
* [[FileFullPath]] | * [[FileFullPath]] |
Revision as of 19:51, 8 November 2021
New to Analytica 6.0
FilePathPart( filepath, part )
Returns the requested «part» of a full file path.
«part» can be one of:
'folder'
: FilePathPart( filepath, 'folder' ) returns the folder part of «filepath», for example:- FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'folder') → "C:\DataFeeds\ISO"
- FilePathPart("C:\DataFeeds\ISO\", 'folder') → "C:\DataFeeds\ISO")
'filename'
: FilePathPart( filepath, 'filename' ) returns just the filename, "" for a directory. For example:- FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'filename') → "HourlyToday.csv"
- FilePathPart("C:\DataFeeds\ISO\", 'filename') → ""
'name'
: FilePathPart( filepath, 'name' ) returns the file or folder name, for example:- FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'name') → "HourlyToday.csv"
- FilePathPart("C:\DataFeeds\ISO\", 'name') → "ISO"
'filename only'
: FilePathPart( filepath, 'filename only' ) returns the filename without an extension- FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'filename only') → "HourlyToday"
'extension'
: FilePathPart( filepath, 'extension' ) returns the lowercase file extension. Is "" for a file without
an extension, or null for a folder.
- FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'extension') → "csv"
- FilePathPart("C:\DataFeeds\ISO\", 'extension') → ""
'parent'
: FilePartPart( filepath, 'parent' ) returns the parent folder which is different from 'folder, in the case of a directory. For example:- FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'parent') → "C:\DataFeeds\ISO"
- FilePathPart("C:\DataFeeds\ISO\", 'parent') → "C:\DataFeeds")
See Also
Comments
Enable comment auto-refresher