Split operation

Hi,
I am getting a path name as “C:\Users\welcome\Desktop\Input file.xlsx”. I just want to extract only the file name which is “Input file.xlsx” and also to the note, it must be applicable if i take from any path()like from -D drive/E drive) . Kindly let me know the manipulation and expression used.

Thanks.

Use this
Path.getFilename(“C:\Users\welcome\Desktop\Input file.xlsx”)

1 Like

@Liveasurheartsay

image

Thanks

1 Like

Getting an error as “GetFileName is not a member of string”

What you have written?

Place

Path.GetFileName(You file path)

Share your screen if not working

Hope this helps

Thanks

1 Like

Capture

First i have assigned the folder contating pdfs to variable Path.
Then have assigned the variable ReadFiles to Directory.GetFiles(Path,“*.pdf”)

First check the path fields use Item.ToString instead of only item
Check in a message box what is appearing in Item.tostring

1 Like

Thanks a lot. Getting it.

Happy Automation!

1 Like

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