Extract file name from the path

Hi,

Input:
F:\19216 enhancement\19216\19216\HC_SC_19216-Deactivation_Report_Analysis.1.0.94\lib\net45\Data\Output\19-04-23_Time_01_24_39_09-04-23_Time_13_55_43_22-02-23_Time_10_02_04_DR File Voluson SPC330 Consoles-Test (1).xlsx

from this i need only
Output:

19-04-23_Time_01_24_39_09-04-23_Time_13_55_43_22-02-23_Time_10_02_04_DR File Voluson SPC330 Consoles-Test (1).xlsx

Thanks in advance
Likitha

Hi @vinjam_likitha ,

Use the below expression to get the file name along with it’s extension:

Path.GetFileName("FullPath")

Regards,

Hi @vishal,

i tried it but for path getfilename is not showing it is throwing an error like name space is not imported

Hi,

Please try to add System.IO. at the beginning of the expression as the following.

Regards,

@vinjam_likitha

Use system.io.Path.GetFileName("FullPath")

Regards,

Thanks @Yoichi @vishal.kp

1 Like

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