2

I have a column of values with "//" as the separator between them. For example, one cell might contain - September 17 2021 // September 18 2021.

I want to compare if what comes before and after the separator are the same, and if so, to delete the separator and everything after. Is there are a way to do this in Open Refine? Thanks for your help!

Hev
  • 35
  • 3

1 Answers1

1

One straighforward way I can think of is splitting the string into an array, remove duplicates and put the string back together. Or to express this in GREL:

value.split(/\s*\/\/\s*/).uniques().join(" // ")
b2m
  • 529
  • 3
  • 11