# How to Split the data

**URL:** <https://forum.uipath.com/t/how-to-split-the-data/169255>\
**Category:** Help\
**Tags:** string, data-manipulation, question, pdf, excel, activities\
**Created:** [November 19, 2019, 5:23am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255 "2019-11-19T05:23:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![soumi\_soumiya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/soumi_soumiya/32/80063_2.png) [@soumi\_soumiya](https://forum.uipath.com/u/soumi_soumiya)\
**Post date:** [November 19, 2019, 5:23am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/1 "2019-11-19T05:23:35Z")

</div>

Hi, I need to extract the data from a pdf file and add it to the excel as each row and column as it is in PDF. I use get full-text activity where I am getting an overall data of pdf how could I split it. Can anyone help me? I have attached the Pdf file and data that got from extracted data.

 ![Capture1](https://global.discourse-cdn.com/uipath/original/3X/d/b/db01122ad6680f3e1feec711545703c6afdc8a4e.png) [inv2.pdf](https://forum.uipath.com/uploads/short-url/uJOxdaRk6HahhJHKbPbWhlcq6UT.pdf) (39.7 KB).

---

<div class="post-metadata">

**Author:** ![vishal.kp](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vishal.kp/32/92454_2.png) [@vishal.kp](https://forum.uipath.com/u/vishal.kp)\
**Post date:** [November 19, 2019, 5:26am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/2 "2019-11-19T05:26:23Z")

</div>

How do you want to split the data. Line by line?

---

<div class="post-metadata">

**Author:** ![lakshman](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lakshman/32/523490_2.png) [@lakshman](https://forum.uipath.com/u/lakshman)\
**Post date:** [November 19, 2019, 5:35am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/3 "2019-11-19T05:35:44Z")

</div>

@soumi_soumiya

You can use REGEX or String manipulation methods to retrieve required data from PDF file and then pass it to excel file to write into it.

---

<div class="post-metadata">

**Author:** ![soumi\_soumiya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/soumi_soumiya/32/80063_2.png) [@soumi\_soumiya](https://forum.uipath.com/u/soumi_soumiya)\
**Post date:** [November 19, 2019, 5:36am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/4 "2019-11-19T05:36:48Z")

</div>

Thanks for Your Reply,  
Can you guide me in Regex and String I am not that much familiar in both

---

<div class="post-metadata">

**Author:** ![Ajju](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ajju/32/21682_2.png) [@Ajju](https://forum.uipath.com/u/Ajju)\
**Post date:** [November 19, 2019, 5:37am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/5 "2019-11-19T05:37:26Z")

</div>

hi @soumi_soumiya

- first you split the whole string based on the newline char

- then you will get a array of item(each line as a item)

- then take the line 6 (from top) and split it based on the space, which give the  
column of the table (use add column activity to add the headers of the table)

- same as above take the 7 item from the main array extract the values using regex then put the values into respective place

for remaining values , it is simply split and get the values.

---

<div class="post-metadata">

**Author:** ![soumi\_soumiya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/soumi_soumiya/32/80063_2.png) [@soumi\_soumiya](https://forum.uipath.com/u/soumi_soumiya)\
**Post date:** [November 19, 2019, 5:37am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/6 "2019-11-19T05:37:28Z")

</div>

Thnkas Vishal For your reply,  
Yes I need to Split Line by Line

---

<div class="post-metadata">

**Author:** ![soumi\_soumiya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/soumi_soumiya/32/80063_2.png) [@soumi\_soumiya](https://forum.uipath.com/u/soumi_soumiya)\
**Post date:** [November 19, 2019, 5:39am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/7 "2019-11-19T05:39:07Z")

</div>

Thanks for your Reply,  
Could you give me an example

---

<div class="post-metadata">

**Author:** ![sarathi125](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sarathi125/32/519448_2.png) [@sarathi125](https://forum.uipath.com/u/sarathi125)\
**Post date:** [November 19, 2019, 5:41am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/8 "2019-11-19T05:41:27Z")

</div>

@soumi_soumiya,

Try like the following, create a string array variable as arrOutput. And get is assigned with the following code in assign activity.

Here strInput is your input string.

```auto
Strinput.split({environment.newline}, stringsplitoption.none) 

```

---

<div class="post-metadata">

**Author:** ![soumi\_soumiya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/soumi_soumiya/32/80063_2.png) [@soumi\_soumiya](https://forum.uipath.com/u/soumi_soumiya)\
**Post date:** [November 19, 2019, 5:47am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/9 "2019-11-19T05:47:33Z")

</div>

> [@sarathi125](#):
>
> Strinput.split({environment.newline}, stringsplitoption.none)

Thanks for your Reply,  
could you say me what should be variable type because stringsplitoption is not getting highlighted

---

<div class="post-metadata">

**Author:** ![vishal.kp](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vishal.kp/32/92454_2.png) [@vishal.kp](https://forum.uipath.com/u/vishal.kp)\
**Post date:** [November 19, 2019, 5:50am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/10 "2019-11-19T05:50:11Z")

</div>

Strinput.split({environment.newline},StringSplitOptions.None)  
Try this

---

<div class="post-metadata">

**Author:** ![soumi\_soumiya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/soumi_soumiya/32/80063_2.png) [@soumi\_soumiya](https://forum.uipath.com/u/soumi_soumiya)\
**Post date:** [November 19, 2019, 5:56am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/11 "2019-11-19T05:56:52Z")

</div>

Thanks for your reply…  
But i want to know what is the variable type should i give for strinput. I used String but stringsplitoptions is not getting highlighted

---

<div class="post-metadata">

**Author:** ![sarathi125](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sarathi125/32/519448_2.png) [@sarathi125](https://forum.uipath.com/u/sarathi125)\
**Post date:** [November 19, 2019, 6:01am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/12 "2019-11-19T06:01:46Z")

</div>

@soumi_soumiya  
[StringSplit.xaml](https://forum.uipath.com/uploads/short-url/qWTFl96ANyn2mqSAMiQJLzqrKQA.xaml) (5.8 KB)

Check this xaml, you will get some idea. You need to enable a disabled activity to assign your input value to the strInput string variable.

---

<div class="post-metadata">

**Author:** ![vishal.kp](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vishal.kp/32/92454_2.png) [@vishal.kp](https://forum.uipath.com/u/vishal.kp)\
**Post date:** [November 19, 2019, 6:01am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/13 "2019-11-19T06:01:58Z")

</div>

can you show the screenshot

---

<div class="post-metadata">

**Author:** ![soumi\_soumiya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/soumi_soumiya/32/80063_2.png) [@soumi\_soumiya](https://forum.uipath.com/u/soumi_soumiya)\
**Post date:** [November 19, 2019, 6:16am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/14 "2019-11-19T06:16:25Z")

</div>

Thanks for your reply  
I worked with this but I am getting the output as **System.String[]** i want to get the value

---

<div class="post-metadata">

**Author:** ![soumi\_soumiya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/soumi_soumiya/32/80063_2.png) [@soumi\_soumiya](https://forum.uipath.com/u/soumi_soumiya)\
**Post date:** [November 19, 2019, 6:16am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/15 "2019-11-19T06:16:54Z")

</div>

Thanks for your Reply,  
I worked with this but I am getting the output as **System.String[]** i want to get the value

---

<div class="post-metadata">

**Author:** ![sarathi125](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sarathi125/32/519448_2.png) [@sarathi125](https://forum.uipath.com/u/sarathi125)\
**Post date:** [November 19, 2019, 6:21am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/16 "2019-11-19T06:21:00Z")

</div>

@soumi_soumiya

 ![new](https://global.discourse-cdn.com/uipath/original/3X/5/b/5b3386166e1da1940cd21b0f70e3c711f5fcf05a.png)

Add a for each loop with String type and pass the output array in it, then print that. you can see the values printing the output window.

---

<div class="post-metadata">

**Author:** ![poojajoshi1](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@poojajoshi1](https://forum.uipath.com/u/poojajoshi1)\
**Post date:** [November 19, 2019, 6:21am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/17 "2019-11-19T06:21:01Z")

</div>

@soumi_soumiya,

You need to use ‘For Each’ loop activity on the Array to get values of the array.

---

<div class="post-metadata">

**Author:** ![soumi\_soumiya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/soumi_soumiya/32/80063_2.png) [@soumi\_soumiya](https://forum.uipath.com/u/soumi_soumiya)\
**Post date:** [November 19, 2019, 6:46am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/18 "2019-11-19T06:46:38Z")

</div>

what should be the type of arrOutput

---

<div class="post-metadata">

**Author:** ![sarathi125](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sarathi125/32/519448_2.png) [@sarathi125](https://forum.uipath.com/u/sarathi125)\
**Post date:** [November 19, 2019, 6:49am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/19 "2019-11-19T06:49:15Z")

</div>

@soumi_soumiya,

Array of string

It is there in the first xaml I have shared.

---

<div class="post-metadata">

**Author:** ![poojajoshi1](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@poojajoshi1](https://forum.uipath.com/u/poojajoshi1)\
**Post date:** [November 19, 2019, 6:51am UTC](https://forum.uipath.com/t/how-to-split-the-data/169255/20 "2019-11-19T06:51:39Z")

</div>

> [@soumi\_soumiya](#):
>
> what should be the type of arrOutput

If you are using For Each Row activity then you should change the Type of argument in the properties to ‘String’.

[Next page](https://forum.uipath.com/t/how-to-split-the-data/169255.md?page=2)
