16-06-23 07:47 AM
Hi All,
Can anyone help me with developing a code stage with C# or VB to convert text to collection
sample Input:
1.The capital of India.
Moscow
#Delhi
Kabul
Tokiyo
2.The capital of Japan.
Moscow
Delhi
Kabul
#Tokiyo
3.The capital of Afganistan.
Moscow
Delhi
#Kabul
Tokiyo
4.The capital of Russia.
#Moscow
Delhi
Kabul
Tokiyo
Output
16-06-23 04:19 PM
Hi,
Did you try to do the same using native BP functions and utilities?
20-06-23 01:18 PM
As @Tejaskumar_Darji has pointed out, you should always try to use the BP VBOs instead of building code for very specific tasks. Even if you need to build code into your objects, the code should be generic enough that it is reusable throughout your processes.
For the above data, you could use the Blue Prism "Utility - Strings" VBO (Blue Prism Digital Exchange - Utility - Strings). In it is an action called "Extract Regex All Matches" that you could pass the following Regex pattern:
(?<Question>.+)[\r\n]+(?<Option1>.+)[\r\n]+(?<Option2>.+)[\r\n]+(?<Option3>.+)[\r\n]+(?<Option4>.+)[\r\n]*