Search code examples
regexgoogle-sheetsgoogle-sheets-formulaarray-formulas

Extracting part of a string in Google Sheets


I'm trying to extract the classname from a list of UE4 blueprint paths that look like this:

"Blueprint'/Game/Aberration/CoreBlueprints/Weapons/PrimalItemAmmo_Zipline.PrimalItemAmmo_Zipline'"

The end result needs to be something like this:

PrimalItemAmmo_Zipline_C

I guess the easiest way would be to extract everything between the "." and the apostrophe at the end, before appending the _C. I've tried a few different solutions I've found online, mostly modified from formulas for getting filenames from filepaths, but I can't get any of them to work properly. What would be the best way to do this?


Solution

  • Assuming the string in A1, try

    =substitute(regexextract(A1, "[^.]*$"), char(39)&char(34), "_C")
    

    and see if that works?