Need to get the value from Text file after the particular Keyword

Hi All,

I have a Text file in the below format. I need to retrieve the USD which is below the Keyword Currency.

I used the method strText.Split({“Currency”},System.StringSplitOptions.RemoveEmptyEntries)(1).Split(System.Environment.Newline(0))(0).Trim am getting only blank information.

Can anyone help me on this.

Currency
USD
USD
USD

Hi @Elamparithi

If you want to get multiple results for each USD, use this in a For Each loop:
inputString.Split({“Currency”},System.StringSplitOptions.RemoveEmptyEntries)(0).Split({System.Environment.Newline},StringSplitOptions.RemoveEmptyEntries)
image Output: image

To access single elements, add an array index at the end:
inputString.Split({“Currency”},System.StringSplitOptions.RemoveEmptyEntries)(0).Split({System.Environment.Newline},StringSplitOptions.RemoveEmptyEntries)(0)

Thanks for the response,

I tried as you said, but am getting different output instead of USD. Am getting the first line of the Text file.

See attachment for reference project:
SplitExample.zip (1.6 KB)

It is probably the structure of your text file. I attached my example so that you can compare the inputs :slight_smile:

I cant able to open your workflow, am getting

Could not find member ‘CurrentIndex’ in type ‘http://schemas.uipath.com/workflow/activities:ForEach(String)’…

Below is the information which i was working in the text file, can you check you can get the result.

?age. I •Dated: 30-07-2618 P//C50 / 36/6 44 fQ-
•O
SCHEDULE FOR OUTWARD: DOCUY. COLLECTION
Please: always.- quote
Mail to
EM
777 No : 90040BCS000601-
collection, We . enclose the following for
Drss Currency
USD
USD
USD
REFERENCE .
For Banda
Autatory
Of
•O

@mircea

I am guessing that this would be an example of a workflow from beta that is not compatible with stable release.

@Elamparithi
Could you confirm the version of the UiPath you are using?

As far as your request goes, could you specify the expected outcome? We could try a regex formula if your requirements will suit it :slight_smile:

Yes, in some cases, workflows built with beta versions may not work with previous or future stable versions. Please make sure you test workflows with stable versions too, before pushing to production. We have migration checks in place but some cases might not be covered. Good news is that 18.3 will soon be pushed to stable as well.

Am using Community version only, will that be an impact in this case.