Pull out only the text after ";" into another column

  • 9 August 2019
  • 4 replies
  • 0 views

Badge +8

I have a column which captures the email subject. All items have the same email subject followed by the relevant/unique country name: 

    emailsubject;country

The country in the email subject makes the email unique. I need to pull the country out into a country column to allow filtering on the country.

 

;w+ works for countries with one word but I need a pattern that will work for single or multiple words in the country name.

For example - using ;w+ for Spain works but for Saudi Arabia it only picks up the Saudi.

 

Thanks

 

@vadim_tabakman 


4 replies

Userlevel 6
Badge +22
Hi,
I would use a regular expression to split the string at the ; and then update the colum with the required country.
No regex is required.
That will put the two halves into a collection variable and you just need to pull out index 1 to get the half that you need.
Badge +8

@SimonMuntz 

Thanks - Can you explain how I pull the index to get the half I require?

Badge +8
Company name,text,moretext
This is my pattern I need to pull the company name only. Please note that the company name may consist of one word two words or more.
Userlevel 6
Badge +22
The regular expression ^[a-zA-Zs]+ shoud work for company names with spaces in them.

Reply