GetFileName (String filePath)
Name | GetFileName |
Syntax | GetFileName (String filePath) |
Purpose | To return file name from the given file path. |
Description | Extracts file name from the given file path. |
Return Type | String |
Parameter | filePath [System.String] – Full path of the file. |
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2F3083465318-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsR50Wa7EwZGlmPSAMkkf%252Fuploads%252FnGn6Ez1bHsCqUvVde8Ge%252F0.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=f0e1330a&sv=1)
Example
In this example, we are passing the required parameter to the function transformation object using a Variables object.
Where,
filePath = C:\Users\Kanwal.Azim\OneDrive - Astera Software\Desktop\Functions Documentation\Files\GetFileName\GetFileName.docx
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2F3083465318-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsR50Wa7EwZGlmPSAMkkf%252Fuploads%252FZQ0G5eZXH1QejvAZAiAj%252F1.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=87cbaf78&sv=1)
Right-click on the function transformation object and select Preview Output. As you can see, Astera Data Stack has returned the file name of the specified file path.
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2F3083465318-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsR50Wa7EwZGlmPSAMkkf%252Fuploads%252FXQD9YKAJcXPBqpwLqcXK%252F2.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=b3bfed2d&sv=1)
Last updated