Template - remove text based on variable

I have a text :
https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/oxedx1RRB29pZ2kwVHF72/pub/x2iytEGwxQQNaBQeFRDx.png

where I would like to extract the image name
x2bK2EGwxQQNaBQeFRDx.png

It can be done by a template column where I replace the folder name
https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/oxedx1RRB29pZ2kwVHF72/
with
Nothing

But I would like the text I want to replace (the folder name) to be put in another column to make it easier to substitute the folder name (as the folder name is used multiple places) with a new folder name - does anybody know if that is possible?

Might be late, but isn’t that just:

  • have a lookup table
  • in a volume put in your Folder string/value
  • do a lookup or single value to that column
  • merge afterward

Or I missed something!

@mark thanks for takling time to answer.

I can’t see this solves my problem. As I see it you suggestion will try to concatenate two strings. I want to extract a certain part of a string - the filename.
The folder I would like to store in a separate column and extract that value from my folder+filename column

1 Like

@Krivo you can do it replacing the folder column to blank in right-hand side in template column, giving you only the filename

1 Like

@Lucas_Pires thx.

But as I see it I still have to type in the foldername on the left hand side (the text to replace). I would have liked to use a columns value for left hand side

@krivo

Sounds like you might need some regex magic to find the first “/” from the right (the one prior to the file name) to result in the position as a number of that “/”. Then split the two values into two columns based on that information.

Never done this before, but I know it’s possible.

1 Like

@Robert_Petitto thanks

In your suggestion I would have to do it in google sheets, right?
You know, I was hoping to do it in the builder

Ya…I know. I try to avoid Google sheets formulas at all cost, but I’m not seeing a straightforward workaround.

1 Like

Trying to makes sense of this. So you obviously have the full url in one column. Do you have any other parts, like the file or folder separately, or is the full url the only thing you have to work with?

I’m just trying to understand the question, what you have, and what you want for the end result.

@Jeff_Hager

I have three columns: full url incl filename, foldername, filename

I would like the filename to be extracted based on the full url and foldername where I “subtract” the foldername from the full url

So you already have the encoded folder name in a separate column?

@Jeff_Hager That is correct.

What I’m doing today is use a template column where I replace the folder name
https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/oxedx1RRB29pZ2kwVHF72/
with
Nothing

But I would like to avoid to put in a “hard-coded” folder name value in the template column - and instead use the information from a column called “foldername”

Bare with me, I’m a little slow today. I think I’m coming around now. I’ve been reading your problem as this.

Have
Full URL: https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/oxedx1RRB29pZ2kwVHF72/pub/x2iytEGwxQQNaBQeFRDx.png
Folder: oxedx1RRB29pZ2kwVHF72

Want
File: x2iytEGwxQQNaBQeFRDx.png

I think I’ve been interpreting your question as the folder is the encoded folder name in part of the path of the url (oxedx1RRB29pZ2kwVHF72). Not the full url path (https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/oxedx1RRB29pZ2kwVHF72/pub/). After rereading a few times, as I understand it, your only goal is to extract the file name (x2iytEGwxQQNaBQeFRDx.png) from the rest of the url, correct? I think the mention of ‘folder name’ was throwing me off and I thought you meant only the encoded part of the url path. When you say folder, you mean the entire url path, minus the file, correct? And again, your only goal is to isolate the file name out of the entire url?

How are you currently isolating the url path (folder name) into it’s own column?

I may have to think on this for a while.

@Jeff_Hager
I’m not explaining myself well, I think :frowning:

as I understand it, your only goal is to extract the file name (x2iytEGwxQQNaBQeFRDx.png) from the rest of the url, correct?

Exactly!

When you say folder, you mean the entire url path, minus the file, correct? And again, your only goal is to isolate the file name out of the entire url?

Exactly!

I should never have put in the foldername in the description - because what I mean is the url which constitutes this:
https://storage.googleapis.com/glide-prod.appspot.com/uploads-v2/oxedx1RRB29pZ2kwVHF72/pub/