Get the file name from a file path.
I have a column that contains file paths.
"/Shared/Users/Bob/bob.txt"
Assume there can be any amount of folders, with names of any length.
I just want an adjacent column to say "bob.txt"
I have tried to find the index of the last "/" and work with that, but to no avail.
How can this be done?
Best Answer
-
Give this a try…
=MID([Column Name]@row, FIND("~", SUBSTITUTE([Column Name]@row, "/", "~", LEN([Column Name]@row) - LEN(SUBSTITUTE([Column Name]@row, "/", "")))) + 1, LEN([Column Name]@row) - (FIND("~", SUBSTITUTE([Column Name]@row, "/", "~", LEN([Column Name]@row) - LEN(SUBSTITUTE([Column Name]@row, "/", ""))))))
Answers
-
Give this a try…
=MID([Column Name]@row, FIND("~", SUBSTITUTE([Column Name]@row, "/", "~", LEN([Column Name]@row) - LEN(SUBSTITUTE([Column Name]@row, "/", "")))) + 1, LEN([Column Name]@row) - (FIND("~", SUBSTITUTE([Column Name]@row, "/", "~", LEN([Column Name]@row) - LEN(SUBSTITUTE([Column Name]@row, "/", ""))))))
-
Fantastic, thank you!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 495 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!