# Split string with decimal places

**URL:** <https://forum.uipath.com/t/split-string-with-decimal-places/422192>\
**Category:** Studio\
**Tags:** split, system, activities\
**Created:** [May 10, 2022, 1:42pm UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192 "2022-05-10T13:42:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gokulvasant](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokulvasant/32/263239_2.png) [@gokulvasant](https://forum.uipath.com/u/gokulvasant)\
**Post date:** [May 10, 2022, 1:42pm UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/1 "2022-05-10T13:42:37Z")

</div>

Hi Guys am trying to split the characters with decimal places, but am not getting:

EB\*C\*IND\*30\*\*\*23\*1000.55\*\*\*\*\*Y here I want to split 1000.55 only, but I cant achieve the same, but am getting value without decimal value. Please help me out how to extract this with decimal values. Thank you for the same.

Regards,  
Gokul.

---

<div class="post-metadata">

**Author:** ![ushu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ushu/32/463480_2.png) [@ushu](https://forum.uipath.com/u/ushu)\
**Post date:** [May 10, 2022, 1:49pm UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/2 "2022-05-10T13:49:37Z")

</div>

@gokulvasant

if you are looking to extract the value with decimal then use the below regex exp

```auto
String Output =System.Text.RegularExpressions.Regex.Match(Input,"\d+\.\d+").ToString

```

**Find workflow below for ref**

[Example.zip](https://forum.uipath.com/uploads/short-url/nzIiVwj6k3CHaiKBKDkkEj1yh7I.zip) (2.5 KB)

 ![Capture](https://global.discourse-cdn.com/uipath/original/4X/e/e/1/ee1183a45aae922d4e9176e6bb65e3b9ee0564e7.png)

---

<div class="post-metadata">

**Author:** ![gokulvasant](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokulvasant/32/263239_2.png) [@gokulvasant](https://forum.uipath.com/u/gokulvasant)\
**Post date:** [May 10, 2022, 2:10pm UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/3 "2022-05-10T14:10:26Z")

</div>

@ushu Thank you for your quick reply, but your solutions only works for decimal values, some times I will get decimal places and some times not. My input may be “EB\*C\*IND\*30\*\*\*23\*1000.55\*\*\*\*\*Y” or “EB\*C\*IND\*30\*\*\*23\*1000\*\*\*\*\*Y”

---

<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:** [May 10, 2022, 2:37pm UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/4 "2022-05-10T14:37:11Z")

</div>

Hi,

How about the following expression?

```
System.Text.RegularExpressions.Regex.Match(yourString,"[.\d]+(?=\D*$)").Value

```

Regards,

---

<div class="post-metadata">

**Author:** ![ushu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ushu/32/463480_2.png) [@ushu](https://forum.uipath.com/u/ushu)\
**Post date:** [May 10, 2022, 3:12pm UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/5 "2022-05-10T15:12:16Z")

</div>

@gokulvasant Can you try the below one

```auto
\d{4}(\.\d+)?

```

 ![Capture](https://global.discourse-cdn.com/uipath/original/4X/c/8/8/c88ec323d18c023250c9cc16faa1100d7fbff06a.png)

 ![Capture1](https://global.discourse-cdn.com/uipath/original/4X/7/9/5/7957a9d304d9bde397bd299ce1aa2327f20aafcd.png)

---

<div class="post-metadata">

**Author:** ![gokulvasant](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokulvasant/32/263239_2.png) [@gokulvasant](https://forum.uipath.com/u/gokulvasant)\
**Post date:** [May 11, 2022, 1:56am UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/6 "2022-05-11T01:56:46Z")

</div>

@Yoichi @ushu both are working fine, thank you for the reply.

---

<div class="post-metadata">

**Author:** ![gokulvasant](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokulvasant/32/263239_2.png) [@gokulvasant](https://forum.uipath.com/u/gokulvasant)\
**Post date:** [May 11, 2022, 7:40am UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/7 "2022-05-11T07:40:18Z")

</div>

@Yoichi @ushu I need one more help on this:

I want to extract this EB\*C\*IND\*30\*\*\*23\*1000\*\*\*\*\*Y characters from the text file, actually am using following code regex:

(?:EB\*C\*IND\*30\*\*\*23\*\d+.\d+\*\*\*\*\*\*Y)

Now in this am getting following output only: EB\*C\*IND\*30\*\*\*23\*1000\*\*\*\*\*Y

In this, also I want to get get decimal places, please help me out.

Thank you.

---

<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:** [May 11, 2022, 7:47am UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/8 "2022-05-11T07:47:03Z")

</div>

Hi,

> [@gokulvasant](#):
>
> `(?:EB*C*IND*30 ***23*\d+.\d+****** Y)`

I don’t think it’s correct regex pattern. Does this work?

If you want to extract decimal number:1000, the following will work.

```
(?<=EB\*C\*IND\*30\*\*\*23\*)[.\d]+(?=\*+Y)

```

Regards,

---

<div class="post-metadata">

**Author:** ![gokulvasant](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokulvasant/32/263239_2.png) [@gokulvasant](https://forum.uipath.com/u/gokulvasant)\
**Post date:** [May 11, 2022, 9:10am UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/9 "2022-05-11T09:10:07Z")

</div>

Thank you @Yoichi

---

<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:** [May 14, 2022, 9:10am UTC](https://forum.uipath.com/t/split-string-with-decimal-places/422192/10 "2022-05-14T09:10:14Z")

</div>

Closed on May 14, 2022, 9:10am UTC

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