-File Path Sample=“C:\Users\11649\Documents\UiPath\Action Centre Invoice Validation Process\Data\Output\OutPut Zip Folder\Zip Folder\Test-1.pdf”
-I want to extract the file name [Test-1] from Whole File Path.
Use
strFileName = system.io.Path.GetFileNameWithoutExtension("C:\Users\11649\Documents\UiPath\Action Centre Invoice Validation Process\Data\Output\OutPut Zip Folder\Zip Folder\Test-1.pdf")
Thanks,
Ashok ![]()
Path.GetFileNameWithoutExtension("C:\Users\11649\Documents\UiPath\Action Centre Invoice Validation Process\Data\Output\OutPut Zip Folder\Zip Folder\Test-1.pdf")
FilePath = "C:\Users\11649\Documents\UiPath\Action Centre Invoice Validation Process\Data\Output\OutPut Zip Folder\Zip Folder\Test-1.pdf"
FileName = System.IO.Path.GetFileNameWithoutExtension(FilePath).ToString
Regards,
Hi @annet_mdamugade,
Good Morning, You can extract the file name and filename without extension as follows.
With Extension:-
Path.GetFileName(“C:\Users\11649\Documents\UiPath\Action Centre Invoice Validation Process\Data\Output\OutPut Zip Folder\Zip Folder\Test-1.pdf”) —> Test-1.pdf
Without Extension:-
Path.GetFileNameWithoutExtension(“C:\Users\11649\Documents\UiPath\Action Centre Invoice Validation Process\Data\Output\OutPut Zip Folder\Zip Folder\Test-1.pdf”) —> Test-1
Please mark it as a solution if it resolves your issue.
filePath = "C:\Users\11649\Documents\UiPath\Action Centre Invoice Validation Process\Data\Output\OutPut Zip Folder\Zip Folder\Test-1.pdf"
fileName = System.IO.Path.GetFileNameWithoutExtension(filePath)
Hope it helps!!
Hie @annet_mdamugade you can try this method
First create string variable to hold the folder path - variable string

create a variable of array of string with hold the file location

use for each to iterate

output result

cheers Happy Automation
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

