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