Skip to main content
Question

How to separate content into separate fields


K_B1
Forum|alt.badge.img+4
  • Participating Frequently
  • 9 replies

We have a list of names and dates, like so

 

McClelland, David (1820 - 1899)

 

We would like to separate the dates from the the name, so everything in parentheses would be extracted and moved to a new column.

 

I know there must be some code for this, but I am not sure what it is.

 

Help!

 

Kevin

 

9 replies

Mike_AutomaticN
Forum|alt.badge.img+21

Hey ​@K_B1!

Rather than using a script for it, I would suggest to use (1) creating a new Formula field, (2) use the formula shown below.

Make sure to replace “Name” with the actual field name where McClelland, David (1820 - 1899) is found.

IF(
  FIND("(", Name),
  MID(
    Name,
    FIND("(", Name) + 1,
    FIND(")", Name) - FIND("(", Name) - 1
  )
)


You’d have the following

 



Output:
 



You can now convert your formula field to a Single Line Text field, or copy and paste the values on a different field if that is what you need!

Let me know if this helps :D 

Mike, Consultant @ Automatic Nation


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6001 replies
  • March 26, 2025

 

There are several different formulas that can extract data. Here is a method that uses REGEX.

 

 

 

Here is a matching formula to get the name by itself.

 

 


K_B1
Forum|alt.badge.img+4
  • Author
  • Participating Frequently
  • 9 replies
  • March 26, 2025

Dear Mike_AutomaticN,

 

Thanks.  This formula mostly worked, but in about 20 intances (in 3K or so), it produce the following weird errors - see images.

 

any recommended modification to the formula?

 

 

Kevin


K_B1
Forum|alt.badge.img+4
  • Author
  • Participating Frequently
  • 9 replies
  • March 26, 2025

Dear Kouvonne -

The first REGEX formula did not seem to work. I copied it exactly and changed {name} accordingly, but it generated an error.

The second REGEX formula, to extract the name only, seems to have worked though I am still checking.

 

Any ideas?

 

Kevin

 


K_B1
Forum|alt.badge.img+4
  • Author
  • Participating Frequently
  • 9 replies
  • March 26, 2025

Dear Mike -

 

The error noted above seems to be associated with foreign characters that look like this: ē, ō, ū

 

While the issues is not universal, these are diacriticals associated with Portuguese, Vietnamese, and Japanese names.


K_B1
Forum|alt.badge.img+4
  • Author
  • Participating Frequently
  • 9 replies
  • March 26, 2025

Ok solved.  It had to do with character encoding.  Fixed.

 


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6001 replies
  • March 27, 2025

Glad you found a solution that worked.

When building formulas, it is helpful to have sample data that encompasses the full range of expected values. 

How did you fix the character encoding?

I am curious about my formula not working. Can you share screen shots of the formula as you typed it, the sample data, and the error that you see?


K_B1
Forum|alt.badge.img+4
  • Author
  • Participating Frequently
  • 9 replies
  • March 28, 2025

I fixed it by manually re-entering some of the diacritical characters. Apparently they were originally copy / pasted into AirTable from Wikipedia and other sites. Somehow they were encoded differently than the rest of the text. I do not know why this broke the formula, only that once I addressed the characters the formula worked.


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6001 replies
  • March 28, 2025

Thanks for explaining how manually retyping the characters worked. Manually retyping text helps surprisingly often.


Reply