Text to collection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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
------------------------------
Rajsudhapriya CN
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-06-23 04:19 PM
Hi,
Did you try to do the same using native BP functions and utilities?
------------------------------
If I was of assistance, please vote for it to be the "Best Answer".
LinkedIn - https://www.linkedin.com/in/tejaskumardarji/
Thanks & Regards,
Tejaskumar Darji
Sr. Consultant-Technical Lead
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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]*
------------------------------
Micheal Charron
Senior Manager
RBC
America/Toronto
------------------------------
RBC
Toronto, Ontario
Canada
