0

I would like to have the document number, version and file extension in their own columns.

I have a column (A) in excel that has data in the following format:

\\xxxxx\xxxxx\xxxxx\xxxxx\xxxxx\xxxxx\xxxxx\xxxxx\93363348_1.pdf

In the above,

  • 93363348 = the document number
  • 1 = the version
  • .pdf = the file extension

Typically the above will be at the end of the string.

I used the below to extract the file extension.

=REPLACE(RIGHT(A1,5),1,SEARCH(".",RIGHT(A1,5)),"")

Any help would be appreciated.

JvdV
  • 70,606
  • 8
  • 39
  • 70
Nathan Holmes
  • 105
  • 2
  • 12
  • Ok, now you just need another formula where you use `\ ` as delimiter and another one where you use `_` as delimiter. With this three formulas you can extract the desired parameters –  Dec 17 '21 at 17:13

1 Answers1

2

What you could try (using MS365) is:

enter image description here

Formula in B1:

=TRANSPOSE(FILTERXML("<t><s>"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"\","."),"_","."),".","</s><s>")&"</s></t>","//s[position()>last()-3]"))

It will spill your thee required values over into columns. For more information about FILTERXML(), I'd like to refer you to this older post.

JvdV
  • 70,606
  • 8
  • 39
  • 70