Extract text from string

Temporary-Failure

Board Regular
Joined
Jul 16, 2010
Messages
140
I have thousands of rows which has string like
Code:
<img src="https://www.rd-shop.de/out/pict/gene/product/1/450_/sposet_gr_14045.jpg" /><br>


String length is not always same, url can vary etc. How I extrack string "sposet_gr_14045.jpg" from cell? It is picture file.
 
Last edited:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
with your example

use PowerQuery

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]Column1[/td][td][/td][td=bgcolor:#70AD47]Column1[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]< img src="https://www.nd-shop.de/out/pictus/generd/product/2/450_450_75/sposet_gr_14045_02.jpg" /><br>[/td][td][/td][td=bgcolor:#E2EFDA]sposet_gr_14045_02.jpg[/td][/tr]
[/table]


Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table13"]}[Content],
    #"Extracted Text Between Delimiters" = Table.TransformColumns(Source, {{"Column1", each Text.BetweenDelimiters(_, "/", """", {1, RelativePosition.FromEnd}, 0), type text}})
in
    #"Extracted Text Between Delimiters"[/SIZE]
 
Upvote 0
If the string always ends the same (i.e. with " /><br>) then you could use:

=TRIM(RIGHT(SUBSTITUTE(LEFT(A1,LEN(A1)-8),"/",REPT(" ",1000)),1000))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top