Splitting the cell value based on a newline

Hi All,

I’m trying to extract the tabular data from PDF File.

The Output is like below:

I want to split the third row of a data-table based on a newline and the values in a third row will vary.

I need to get the Output like

Sample 1:- 11:Vector data
Sample 2:- 12:Generics
Sample 3:- 13:Conversion Metal
Sample 4:- 14:Fluid Type

Can anyone help me to provide me a logic to solve this issue
@Palaniyappan @ppr @lakshman

1 Like

Assign lines (as array of string) = dt.Rows(3)(“Column-0”).ToString.Split(new String() {Environment.NewLine},StringSplitOptions.None) .
Try this for the first cell of third row.

1 Like

Can you please post the EXCEL from the screenshot here? With this we can faster develop a suggestion and also test it

SampleData.xlsx (8.2 KB)



have a look here:
Shivaraju.xaml (10.3 KB)

there were some surprising cleansings to do. So I did it on several steps to be flexible on adoptions and maintenace.

Kindly note: rewire the excel path according to your environment

1 Like

Thank you @ppr

I will check the xaml file and update you.

The xaml file is working fine.
Thank you for your Valuable time and effort.

How can i store the Output values in Variables like Sample1,Sample2,…

it depends a little bit on what you want you wnat to do it. I would not recommend to store it in seperate values.

A dictionary could be a good option: mydict("Sample1) = Value and fill this up dynamicly. (I can help you on this for a handy statement)

For an output into log or msg box the join function could help as well.

Can you just elaborate on your needs and we will find the appropriate approach. Thanks

1 Like

I want to save these Values in a excel so that am creating variables from Sample1 to Sample10 and assigning the item Value to Sample Variable and then adding these variables to “Add Data row” and finally with “Write Range” saving into an excel


Have a look on updated XAML.
Shivaraju_V2.xaml (11.1 KB)

You can use dtSamples and write it to EXCEL.
Checkout the Variable Section and do notice the dtSample and its initialization within the default Value


Thank you very much @ppr
I had learnt few concepts from you.

You are welcome. Happy Automation :+1:

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