Help

Re: Extract given number of words from a field of comma separated words

1833 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Phill_Dettman
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi all.

I have a field which contains a list of 50 words/phrases that are all separated by commas, in order of importance with the most important being first. Let’s called this field ‘50W’

I have some other fields that I want to auto populate/extract from ‘50W’. One of them is called ‘1W’ which should extract only the first word/phrase, meaning everything in front of the first comma.

Then I have another field called ‘10W’ which i want to extract the first 10 words/phrases, everything in front of the 10th comma.

It would be great if this was possible but I can’t seem to do it whatever i try.

Does anyone have any ideas I can try?

Many thanks.

Phill

14 Replies 14

Oh, hell, I forgot to make that fix.

You’ll probably want to make this change in an external editor (and if you created that 50-step SWITCH() using Airtable’s internal editor, you’re a far better man than I…):

  • replace {50W} with {50W}&','

I think that’s the issue: The routine is looking for the Xth comma in a list containing only (X-1) commas. You might want to test it first by making that change in one of the branches and running it against a word list with the same number of words as W for that branch.

Phill_Dettman
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you so much, this is AMAZING!!!

Indeed I am not a better man than you as I didn’t brave entering the 50-step switch using Airtable’s internal editor… I am not insane… although having realised that would have been silly, I take some comfort in the knowledge that although i’m not the better man, I’m not daft… :slightly_smiling_face:

Your contributions to my dilemma have really enabled me to add functionality to my base which I didn’t actually believe was possible. You are a very valuable resource to the Airtable community and I hope the folks at Airtable acknowledge this, as your advice, input and suggestions make their tool more valuable.

Thank you VERY much @W_Vann_Hall

Phill

Thom_Hounsell
6 - Interface Innovator
6 - Interface Innovator

I’ve learned much from this thread. Thanks all. But I can’t help but wonder, would you not be better off importing the word/phrase collections as individual fields in a record? That way, you could manipulate them many ways with little effort. I don’t understand why it would be better to store these values as text blobs when you already have a seperator you can use to import them as atomic values?

For me, i need the words & phrases formatted as comma separated values as these get uploaded to various places. Each place i upload them to requires (or permits) differing quantities of keywords/phrases.

Additionally, often times, when i am researching & finding my words, they are already created as comma separated words.

So I could nail down the words one by one, each to their own fields… but it would take me longer to do this (unless i had a formula to strip away the commas) and it wouldn’t make too much sense, as i’d need another formula later on to put the commas back in for each upload.

so i decided the best approach was to pull in all the words (comma separated) into a ‘master’ field (containing all 50 words) and then extract from there as many as i need for each case.

sounds a bit weird i know, but as Tupac once sang… ‘That’s just the way it is’ … :slightly_smiling_face:

Glad you got some value from this thread. I certainly did. I have also been telling other FB group members to use this community forum as it’s an amazing resource… even if you just read through existing threads (as you have done) you can get all sorts of great ideas…

it wasn’t you i told to come here and read through old posts was it? :slightly_smiling_face:

cheers.

@W_Vann_Hall
I have a bunch of recipes (food) in pages and PDF format that I am trying to insert comma’s between #, Unit, ingredient (so that they will populate in different columns in the database). Would your hashtag extractor work at putting a comma between those values?