Thread: Extract text
View Single Post
  #7   Report Post  
Harlan Grove
 
Posts: n/a
Default

someone wrote...
I would like to extract a section of text from a list of drawing

numbers.

For example ....
LEFT\ADV CONT\S3JL081P0251 REV D.DWG
LEFT\ADV CONT\S3JL081P0252 REV E.DWG
LEFT\ADV CONT\S3JL081P0253 REV D.DWG
LEFT\ADV CONT\S4JL081P0254 REV E.DWG
LEFT\ADV CONT\S4JL081P0255 REV F.DWG
LEFT\ADV CONT\S4JL081P0256 REV F.DWG

The part I want to extract is anything inclusive from "S3" or "S4" to

the
end of the text string but not including the ".dwg" part


If all records start with 'LEFT\ADV CONT\', then you already have a few
workable answers. If records could start with other stuff, and if what
you want is equivalent to the base filename of partial pathname, i.e.,
everything after the rightmost '\' but excluding the first period to
the right of it and any subsequent text, then the general approach
would be using an array formula like

=LEFT(MID(x,MAX(IF(MID(x,seq,1)="\",seq))+1,1024),
FIND(".",MID(x,MAX(IF(MID(x,seq,1)="\",seq))+1,102 4))-1)

where x is the address of the cell you're parsing and seq is a defined
name referring to something like

=ROW(INDIRECT("1:1024"))