Difference between revisions of "FilePathPart"
(Created page with "category:File system functions ''New to Analytica 6.0'' == FilePathPart( filepath, part ) == Returns the requested «part» of a full file path. «part» can be o...") |
(Corrections to examples EW 20133) |
||
Line 21: | Line 21: | ||
FilePathPart( filepath, 'filename' ) returns just the filename, "" for a directory. | FilePathPart( filepath, 'filename' ) returns just the filename, "" for a directory. | ||
Examples: | Examples: | ||
− | • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", ' | + | • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'filename') → "HourlyToday.csv" |
− | • FilePathPart("C:\DataFeeds\ISO\", ' | + | • FilePathPart("C:\DataFeeds\ISO\", 'filename') → "" |
FilePathPart( filepath, 'name' ) returns the file or folder name. | FilePathPart( filepath, 'name' ) returns the file or folder name. | ||
Line 29: | Line 29: | ||
FilePathPart( filepath, 'filename only' ) returns the filename without an extension | FilePathPart( filepath, 'filename only' ) returns the filename without an extension | ||
− | • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", ' | + | • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'filename only') → "HourlyToday" |
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", ' | + | • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'extension') → "csv" |
− | • FilePathPart("C:\DataFeeds\ISO\", ' | + | • FilePathPart("C:\DataFeeds\ISO\", 'extension') → "" |
FilePartPart( filepath, 'parent' ) returns the parent folder which is different from 'folder, in the case of a directory. | FilePartPart( filepath, 'parent' ) returns the parent folder which is different from 'folder, in the case of a directory. | ||
− | • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", ' | + | • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'parent') → "C:\DataFeeds\ISO" |
− | • FilePathPart("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 21:19, 17 March 2021
New to Analytica 6.0
FilePathPart( filepath, part )
Returns the requested «part» of a full file path.
«part» can be one of:
'folder'
'filename'
'name'
'filename only'
'extension'
'parent'
FilePathPart( filepath, 'folder' ) returns the folder part of «filepath» Examples: • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'folder') → "C:\DataFeeds\ISO" • FilePathPart("C:\DataFeeds\ISO\", 'folder') → "C:\DataFeeds\ISO")
FilePathPart( filepath, 'filename' ) returns just the filename, "" for a directory. Examples: • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'filename') → "HourlyToday.csv" • FilePathPart("C:\DataFeeds\ISO\", 'filename') → ""
FilePathPart( filepath, 'name' ) returns the file or folder name. • 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 • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'filename only') → "HourlyToday"
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') → ""
FilePartPart( filepath, 'parent' ) returns the parent folder which is different from 'folder, in the case of a directory. • FilePathPart("C:\DataFeeds\ISO\HourlyToday.csv", 'parent') → "C:\DataFeeds\ISO" • FilePathPart("C:\DataFeeds\ISO\", 'parent') → "C:\DataFeeds")
Enable comment auto-refresher