# Split multi-valued cells

**URL:** <https://forum.openrefine.org/t/split-multi-valued-cells/760>\
**Category:** Data cleaning and transformations\
**Tags:** hints-and-tips\
**Created:** [May 15, 2023, 7:43am UTC](https://forum.openrefine.org/t/split-multi-valued-cells/760 "2023-05-15T07:43:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alessandro\_Zonin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/alessandro_zonin/32/483_2.png) [@Alessandro\_Zonin](https://forum.openrefine.org/u/Alessandro_Zonin)\
**Post date:** [May 15, 2023, 7:43am UTC](https://forum.openrefine.org/t/split-multi-valued-cells/760/1 "2023-05-15T07:43:24Z")

</div>

Hi there. I am trying to split multi-valued cells and generate a new row for each character in a specific cell. Is there a way to do this? Any help would be appreciated. Thank you!

Alessandro

---

<div class="post-metadata">

**Author:** ![Michael\_Markert](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/michael_markert/32/88_2.png) [@Michael\_Markert](https://forum.openrefine.org/u/Michael_Markert)\
**Post date:** [May 15, 2023, 10:06am UTC](https://forum.openrefine.org/t/split-multi-valued-cells/760/2 "2023-05-15T10:06:53Z")

</div>

Hi,  
you can split your strings between each character using an empty regex and then join it to a new string using a separator like |

```auto
value.split(//).join("|")

```

Then you can “Split multi-valued cells…” with “|” as the separator.

Best  
Michael

---

<div class="post-metadata">

**Author:** ![Alessandro\_Zonin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/alessandro_zonin/32/483_2.png) [@Alessandro\_Zonin](https://forum.openrefine.org/u/Alessandro_Zonin)\
**Post date:** [May 15, 2023, 10:12am UTC](https://forum.openrefine.org/t/split-multi-valued-cells/760/3 "2023-05-15T10:12:28Z")

</div>

> [@Michael\_Markert](#):
>
> `value.split(//).join("|")`

Thanks for the quick response. Unfortunately it works but not for special characters such emoji that is transformed in �.

Any idea? Thanks a lot.

![immagine](https://europe1.discourse-cdn.com/flex017/uploads/openrefine/original/1X/9946b8900dd6754346b7450644024ca5b66928fc.png)

---

<div class="post-metadata">

**Author:** ![Michael\_Markert](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/michael_markert/32/88_2.png) [@Michael\_Markert](https://forum.openrefine.org/u/Michael_Markert)\
**Post date:** [May 15, 2023, 10:27am UTC](https://forum.openrefine.org/t/split-multi-valued-cells/760/4 "2023-05-15T10:27:58Z")

</div>

I have no clue. I would transform the emojis to their Unicode counterpart before the import to OR so that I get something generic I can match against with a regex expression.

---

<div class="post-metadata">

**Author:** ![ostephens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/ostephens/32/8_2.png) [@ostephens](https://forum.openrefine.org/u/ostephens)\
**Post date:** [May 15, 2023, 11:21am UTC](https://forum.openrefine.org/t/split-multi-valued-cells/760/5 "2023-05-15T11:21:57Z")

</div>

I’ve never been 100% sure why `value.split(//)` works as it does, but it definitely breaks in this case!

I think you can use the following instead:  
`value.find(/./).join("|")`

This should deal with the emojis OK (at least in my testing)

---

<div class="post-metadata">

**Author:** ![Alessandro\_Zonin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/alessandro_zonin/32/483_2.png) [@Alessandro\_Zonin](https://forum.openrefine.org/u/Alessandro_Zonin)\
**Post date:** [May 15, 2023, 3:00pm UTC](https://forum.openrefine.org/t/split-multi-valued-cells/760/6 "2023-05-15T15:00:27Z")

</div>

It works! Thank you! You made my day!

---

<div class="post-metadata">

**Author:** ![Michael\_Markert](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/michael_markert/32/88_2.png) [@Michael\_Markert](https://forum.openrefine.org/u/Michael_Markert)\
**Post date:** [May 17, 2023, 6:28am UTC](https://forum.openrefine.org/t/split-multi-valued-cells/760/7 "2023-05-17T06:28:20Z")

</div>

Same here with split(//). Thanks for the tip!
