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).


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

icon

Best answer by ebygomm 22 March 2021, 11:02

View original

5 replies

Userlevel 1
Badge +10

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!

Userlevel 1
Badge +10

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?

Userlevel 1
Badge +10

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]$

 

Reply