# Split a string excel

**URL:** <https://forum.uipath.com/t/split-a-string-excel/305337>\
**Category:** Help\
**Tags:** question, activities, excel, system\
**Created:** [April 9, 2021, 1:02am UTC](https://forum.uipath.com/t/split-a-string-excel/305337 "2021-04-09T01:02:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenkim](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jenkim](https://forum.uipath.com/u/jenkim)\
**Post date:** [April 9, 2021, 1:02am UTC](https://forum.uipath.com/t/split-a-string-excel/305337/1 "2021-04-09T01:02:55Z")

</div>

Hi all,

I’m trying to split a string from one column and want to turn it into multiple column after the split.

Original data

 ![image](https://global.discourse-cdn.com/uipath/original/3X/6/9/69b4f47ff79c3c6da2c79698797f561708582661.png)

e.g.  
data - emailoutlook\_20201222\_12343.xlsx

I managed to split the first column using regex - emailoutlook\_20201222  
The last column - .xlsx

My only problem is to split the digits in between - 12343

If I use regex (\d{5}), it will also capture the front digits.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [April 9, 2021, 1:11am UTC](https://forum.uipath.com/t/split-a-string-excel/305337/2 "2021-04-09T01:11:38Z")

</div>

Hi,

Hope the following helps you.

![img20210409-2](https://global.discourse-cdn.com/uipath/original/3X/2/3/23b15373ca31748186ad34a9801333674f79aea5.png)

[Main.xaml](https://forum.uipath.com/uploads/short-url/7WtiikerBj1DH9TTuJfhjNgQVTW.xaml) (6.0 KB)

Regards,

---

<div class="post-metadata">

**Author:** ![jenkim](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jenkim](https://forum.uipath.com/u/jenkim)\
**Post date:** [April 9, 2021, 1:27am UTC](https://forum.uipath.com/t/split-a-string-excel/305337/3 "2021-04-09T01:27:37Z")

</div>

Hi @Yoichi,

Thank you for your solution but it seems like it’s not working if I put it inside my for each row since the data are inside the excel.

![image](https://global.discourse-cdn.com/uipath/original/3X/d/5/d50e95c874d4b7462bf4c97d7d381aa83533b09a.png)

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [April 9, 2021, 1:30am UTC](https://forum.uipath.com/t/split-a-string-excel/305337/4 "2021-04-09T01:30:07Z")

</div>

Hi,

Can you try to write `row("Text").ToString` instead of `row("Text")`?

Regards,

---

<div class="post-metadata">

**Author:** ![jenkim](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jenkim](https://forum.uipath.com/u/jenkim)\
**Post date:** [April 9, 2021, 1:39am UTC](https://forum.uipath.com/t/split-a-string-excel/305337/5 "2021-04-09T01:39:25Z")

</div>

Okay @Yoichi !

I got my solution. Thank you for your kind help.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [April 12, 2021, 1:39am UTC](https://forum.uipath.com/t/split-a-string-excel/305337/6 "2021-04-12T01:39:54Z")

</div>

Closed on April 12, 2021, 1:39am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
