Need to Retrieve the next line from the Array

Hello All,
Below is the scenario, Were i require you support to complete this.

I have extract the PDF data to text file and i need to get the specific data from the txt file.

Attached snapshot, In that i need to get the 2 line(State name). In some scenario state name is not available so then the 3 line will placed at 2.

image

Kind Regards
Kabeer Ahamed B

Fine
So suppose if we are getting the text like this alone
str_input = “CustomerName
Gurgaon
HSN Code
Rental”

So now use a assign activity like this
list_string = str_input.Split(Environment.NewLine.ToArray()).ToList()
Where list_string is a variable of type System.Collections.Generic.List(of string) defined in the variable panel with default type as New list(of string)

So use a IF condition like this
list_string.Count.Equals(4)
If true it will go to THEN part were use a assign like this
Str_output = list_string(1).ToString
If the above condition fails it will go to ELSE part where we can use a assign activity
Str_output = String.Empty

Cheers @Kabeer

Thanks Palaniyappan,
Let me try.
Whether we call multiple array in single output.
E.g
Peter’s Road Royapettah Chennai 600018

If i have splitted the string as per “space” then
Then my array output will be
Peter’s Road Royapettah Chennai 600018
0 1 2 3 4

I need to get 0 & 1 separate and 3 separate and 4 separate.

whether it can be possible! Waiting for your support

Yah that’s possible
But we need to mention the index and concatenate them
Like
array(0).ToString+array(1).ToString
array(2).ToStting
array(3).ToString

And in your case ensure that the string format is same else we will be facing issue while using this split method like though it splits it won’t give us the required output

Kindly try once and let know for any queries or clarification
Cheers @Kabeer

1 Like

Thanks Palani,
Its working. Whether we can get the pincode without the split function.