How to Split the data

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 inv2.pdf (39.7 KB).

1 Like

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

@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.

2 Likes

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

1 Like

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.

2 Likes

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

Thanks for your Reply,
Could you give me an example

@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.

Strinput.split({environment.newline}, stringsplitoption.none) 
2 Likes

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

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

2 Likes

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

@soumi_soumiya
StringSplit.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.

1 Like

can you show the screenshot

1 Like

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

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

@soumi_soumiya

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.

@soumi_soumiya,

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

1 Like

what should be the type of arrOutput

@soumi_soumiya,

Array of string

It is there in the first xaml I have shared.

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

1 Like