# Move cell contents left, if left cell is empty

**URL:** <https://forum.openrefine.org/t/move-cell-contents-left-if-left-cell-is-empty/946>\
**Category:** Data cleaning and transformations\
**Created:** [September 1, 2023, 9:25am UTC](https://forum.openrefine.org/t/move-cell-contents-left-if-left-cell-is-empty/946 "2023-09-01T09:25:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Padraic](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/padraic/32/148_2.png) [@Padraic](https://forum.openrefine.org/u/Padraic)\
**Post date:** [September 1, 2023, 9:25am UTC](https://forum.openrefine.org/t/move-cell-contents-left-if-left-cell-is-empty/946/1 "2023-09-01T09:25:00Z")

</div>

I have an OpenRefine project where I have many subject columns, and many subject(places) columns. Not every column is filled for every record.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/openrefine/original/1X/17de497f75c5ca5d1e5e9778e4d9fa690dce5540.png)

I want to move the contents of each column along to the left, if the left cell is empty - but only within specific column groups. So in the image above I would move 'Charleville' to Subject(Places)\_1 but I wouldn't move 'North Strand' into Subjects\_20.

I imagine the best way to do it is one column at a time, but I don't know how to do so. Is it possible?

---

<div class="post-metadata">

**Author:** ![Padraic](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/padraic/32/148_2.png) [@Padraic](https://forum.openrefine.org/u/Padraic)\
**Post date:** [September 1, 2023, 9:59am UTC](https://forum.openrefine.org/t/move-cell-contents-left-if-left-cell-is-empty/946/2 "2023-09-01T09:59:21Z")

</div>

Answering my own question.

I joined all columns in the same group (so all 'Subjects', all 'Subject)Places'). When joining select the option to 'Skip nulls' and use a separator character. I used '|'.

Then split the column based on the '|'. This creates new columns, but only as many as necessary so blank cells are avoided where possible.
