ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extract image paths from within html in a column (https://www.excelbanter.com/excel-programming/447802-extract-image-paths-within-html-column.html)

tdunford

Extract image paths from within html in a column
 
I've been trying to figure this out and just have been unable to. It's important that I figure out how to extract image paths that are in html code in all cells in a column. The image paths are not full url's. Here's an example:

<img src="images/stories/example.jpg" width="450" height="300" alt="Example" /

...and that code would be in the html code of an entire page and the html code is within a cell in a long column. What I need to figure out is how to exact this from that image code:

images/stories/example.jpg

...and that's it. Normally I would just Find & Replace something like "images" with a "|" and then copy the column into notepad and then paste it back into a new column in Excel and then open the text import manager thingy and then specify "|" and then I would have a column that starts with /stories/example.jpg. Then I would do the same thing with "jpg" and then I would have "/stories/example." then I would just add "images to the front of that and "jpg" to the back and be done with it, but this method isn't working because of the html code or something I don't know. So any suggestions would be GREATLY appreciated. Thanks.

plinius

Extract image paths from within html in a column
 
Il 07/12/2012 20:14, tdunford ha scritto:
I've been trying to figure this out and just have been unable to. It's
important that I figure out how to extract image paths that are in html
code in all cells in a column. The image paths are not full url's.
Here's an example:

<img src="images/stories/example.jpg" width="450" height="300"
alt="Example" /

..and that code would be in the html code of an entire page and the
html code is within a cell in a long column. What I need to figure out
is how to exact this from that image code:

images/stories/example.jpg

..and that's it. Normally I would just Find & Replace something like
"images" with a "|" and then copy the column into notepad and then paste
it back into a new column in Excel and then open the text import manager
thingy and then specify "|" and then I would have a column that starts
with /stories/example.jpg. Then I would do the same thing with "jpg" and
then I would have "/stories/example." then I would just add "images to
the front of that and "jpg" to the back and be done with it, but this
method isn't working because of the html code or something I don't know.
So any suggestions would be GREATLY appreciated. Thanks.





I'm not sure to understand
Try this formula
=MID(A1,SEARCH("images",A1),SEARCH("jpg",A1)-SEARCH("images",A1)+3)

Hi,
E.


All times are GMT +1. The time now is 01:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com