Filename

Can anyone let me know how we can do that ?
If I have for eg: “c:\folder\file.txt”, I want to get “file.txt”

multiple ways of doing this(based on the scenarios)

  1. if we know exact path “c:\folder\file.txt” then split by ‘’ and it will give u string array and at last index you will find “file.txt”
  2. if you know folder path “c:\folder” then you can get all file names in list that is present in that folder. in your case on 1 file will be present. so list will have 1 row only having “file.txt”.

hope i answer your query.

I am trying to use the split function but it gives me the error saying:

Option Strict On disallows implicit conversion from String to Char

Hey @nole_1

Just Use this - `

System.IO.Path.GetFileName("c:\folder\file.txt")

Regards…!!
Aksh

2 Likes

@aksh1yadav hiiii, say a list of files in folder and I want the file names of all, so what’s the process to get each and every file name in a folder.

Hey @venkatmalla6

Just you have to get all files inside a directory by using Directory.GetFiles(“your Folder Path here”) then use for each Activity with String Argument then use above mentioned code inside foreach.

Sample- sample1.xaml (6.4 KB)

Regards…!!
Aksh

1 Like

@aksh1yadav thanks buddy i got it.