Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Pulling just the filename

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cardinal - 30 Jun 2006 18:21 GMT
I have a column in my spreadsheet that has a bunch of image names and
paths. Example: images/taapay-040.gif

Is there a way that I can pull out just the filename? This would make
things so much easier for me and save me a ton of editing. Thank you
very much.
Bob Phillips - 30 Jun 2006 18:34 GMT
=MID(A1,FIND("/",A1,LEN(A1)-LEN(SUBSTITUTE(A1,"/","")))+1,255)

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

> I have a column in my spreadsheet that has a bunch of image names and
> paths. Example: images/taapay-040.gif
>
> Is there a way that I can pull out just the filename? This would make
> things so much easier for me and save me a ton of editing. Thank you
> very much.
Cardinal - 30 Jun 2006 18:59 GMT
Oh boy, my fault - please forgive me. Your function worked perfectly
although I now realize that I left out one important item. Not all the
paths are the same. They might one level or several levels deep. All of
these are possibilites:

images/taasec-004.gif
data/images/taasec-004.gif

Thanks and sorry for forgetting this in my original post.
Gord Dibben - 30 Jun 2006 20:53 GMT
If the hyphen is common to all, try Data>Text to Columns with the hyphen as
delimiter.

Gord Dibben  MS Excel MVP

>Oh boy, my fault - please forgive me. Your function worked perfectly
>although I now realize that I left out one important item. Not all the
[quoted text clipped - 5 lines]
>
>Thanks and sorry for forgetting this in my original post.
Bob Phillips - 30 Jun 2006 22:35 GMT
=MID(A1,FIND("~",SUBSTITUTE(A1,"/","~",LEN(A1)-LEN(SUBSTITUTE(A1,"/",""))))+
1,255)

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

> Oh boy, my fault - please forgive me. Your function worked perfectly
> although I now realize that I left out one important item. Not all the
[quoted text clipped - 5 lines]
>
> Thanks and sorry for forgetting this in my original post.
CLR - 30 Jun 2006 18:56 GMT
=MID(A1,FIND("/",A1,1)+1,99)

Vaya con Dios,
Chuck, CABGx3

> I have a column in my spreadsheet that has a bunch of image names and
> paths. Example: images/taapay-040.gif
>
> Is there a way that I can pull out just the filename? This would make
> things so much easier for me and save me a ton of editing. Thank you
> very much.
CLR - 30 Jun 2006 19:37 GMT
Or this.......

=MID(A1,FIND("s/",A1,1)+2,99)

Vaya con Dios,
Chuck, CABGx3

> =MID(A1,FIND("/",A1,1)+1,99)
>
[quoted text clipped - 7 lines]
> > things so much easier for me and save me a ton of editing. Thank you
> > very much.
Ron Rosenfeld - 01 Jul 2006 12:17 GMT
>I have a column in my spreadsheet that has a bunch of image names and
>paths. Example: images/taapay-040.gif
>
>Is there a way that I can pull out just the filename? This would make
>things so much easier for me and save me a ton of editing. Thank you
>very much.

Download and install Longre's free morefunc.xll add-in from
http://xcell05.free.fr/

Then use the formula:

=REGEX.MID(A1,"(?<=/)[^/]+$")

to return the last string that follows a "/"
--ron
Harlan Grove - 01 Jul 2006 23:13 GMT
Ron Rosenfeld wrote...
...
>Then use the formula:
>
>=REGEX.MID(A1,"(?<=/)[^/]+$")
>
>to return the last string that follows a "/"

You don't need the assertion. The following is sufficient.

=REGEX.MID(A1,"[^/]+$")
Ron Rosenfeld - 02 Jul 2006 01:41 GMT
>Ron Rosenfeld wrote...
>...
[quoted text clipped - 7 lines]
>
>=REGEX.MID(A1,"[^/]+$")

Thanks.
--ron

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.