I can extract only the entire block of text (3 rows) using the Get Text activity and the output string variable is ClientInfo.
How would you suggest to extract individually Client ID, Name and Country?
I think I should use Split to seperate per rows (0, 1 and 2) and then for each row to use Substring to extract the part after space.
… but I don’t know how
First split the get text output string with this below code,
ArrStr(String array type) = InputStr.Split( Environment.NewLine.ToCharArray)
Then use below code to get the value,
ArrStr(0).Split(“:”.ToCharArray)(1).Trim
I am referring to the generating yearly report assignment.
I am facing the problem to extract the TaxID from the ACME system.
I tried to use your code with my variable. The Get Text has been assigned to ClientInformation and I would like to extract the first row (TaxID) value. Here is the screenshot:
@Sam_Kong Can you Show us what is the error that you get ? (0) Means that you are selecting the First Element after Splitting the values into an Array.
Thank you. It is working but i would like to know what actually “Client ID” split does in this expression coz i just gave xyz instead of client id but still i am getting the client id value
Your expression
Assign ClientID = System.Text.RegularExpressions.Regex.Split(Split(Split(ClientInfo,“:”)(1),“Client ID”)(0).Trim,“\n”)(0)
in 1st split i understand we are fetching QS86336 ClientName and in second split we are applying only on the result of the first split so the result does not contain client id then how split with “Client ID” would work
Thanks,
Ula
@Boopathi To retrieve Client ID, it Should have been Splitted with Client Name, and to Retrieve Client Name, it Should have been Client Country.
Actually with the value “xyz”, it doesn’t Split accordingly, But since it takes the first Element after Split, Still the Content remains the same, and at last due to the Split based on Newline, It correctly extracts the Needed value.
I think there is a Correction needed in that post , But since it worked properly i couldnt recognise the error