Skip to main content
Solved

I am trying to remove duplicates within an attribute that vary per cell. For example in the column (ukHabpCode) I have uu1bu1b5 which separated would be u,u1b,u1b5, but I want to remove the duplicates so I am just let with u1b5 (see figure below).

  • March 22, 2021
  • 5 replies
  • 49 views

Screenshot 2021-03-22 at 09.41.05Thanks for any help!

Best answer by ebygomm

So you could use a stringsearcher to get the alternate letter number combination at the end of the string

[A-Za-z]\d[A-Za-z]\d$

So this would give you u1b5, r1a6, g1a6 etc.

But how do you want the other cases handled?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • March 22, 2021

So you could use a stringsearcher to get the alternate letter number combination at the end of the string

[A-Za-z]\d[A-Za-z]\d$

So this would give you u1b5, r1a6, g1a6 etc.

But how do you want the other cases handled?


Thats great! for the other columns, I want to keep the s, the blank as these do not contain duplicates, and the columns that are like ff2d I want f2d as the output? Thanks so much!


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • March 22, 2021

Thats great! for the other columns, I want to keep the s, the blank as these do not contain duplicates, and the columns that are like ff2d I want f2d as the output? Thanks so much!

If you add a * to the regex to make the last digit optional i think that works for the ff2d scenarios as well

[A-Za-z]\d[A-Za-z]\d*$

Then if you want to match a single letter as well you can add an alternative regex match by separating the two statements with the pipe character |

[A-Za-z]\d[A-Za-z]\d*$|^[A-Za-z]$

 


If you add a * to the regex to make the last digit optional i think that works for the ff2d scenarios as well

[A-Za-z]\d[A-Za-z]\d*$

Then if you want to match a single letter as well you can add an alternative regex match by separating the two statements with the pipe character |

[A-Za-z]\d[A-Za-z]\d*$|^[A-Za-z]$

 

yes that works, do you know what expression will allow me to include the s value?


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • March 22, 2021

If you add a * to the regex to make the last digit optional i think that works for the ff2d scenarios as well

[A-Za-z]\d[A-Za-z]\d*$

Then if you want to match a single letter as well you can add an alternative regex match by separating the two statements with the pipe character |

[A-Za-z]\d[A-Za-z]\d*$|^[A-Za-z]$

 

The second regex expression above should match a single letter, so should work for the s value

[A-Za-z]\d[A-Za-z]\d*$|^[A-Za-z]$