how to remove duplicate from String?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-05-22 05:21 AM
Hi,
I have a string Input="225336675992", I need to remove Duplicate number which followed by Other. i need output aas
output="25367592".kindly help me.
------------------------------
Sai
------------------------------
I have a string Input="225336675992", I need to remove Duplicate number which followed by Other. i need output aas
output="25367592".kindly help me.
------------------------------
Sai
------------------------------
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-05-22 06:14 AM
Hi Sai,
Use regex expression to remove duplicate numbers.
------------------------------
Devendra Kumar Prajapati
RPA Manager
Infosys
Chandigarh, India
------------------------------
Use regex expression to remove duplicate numbers.
------------------------------
Devendra Kumar Prajapati
RPA Manager
Infosys
Chandigarh, India
------------------------------
Devendra Kumar Prajapati
RPA Manager
Infosys
Chandigarh, India
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-05-22 06:44 AM
Hi Sai,
There are many ways to do this : A code stage , Regular Expression and a logic using Calculation stage and decisions.
I have attached the simple solution using Calculation stages. Remove the .txt from the file name and then import the BP Release. The logic is to extract each character from Input String, store the character in a data item and then compare the current character with the previous one. If the current character doesn't match the previous one, the flow will keep on concatenating and store it in the output data item. Since, the input is a string, it will work for numbers as well as letters or a combination of both. Let me know if you need any help.
------------------------------
Vikrant Sharma
Senior Solution Designer
Blue Prism
------------------------------
There are many ways to do this : A code stage , Regular Expression and a logic using Calculation stage and decisions.
I have attached the simple solution using Calculation stages. Remove the .txt from the file name and then import the BP Release. The logic is to extract each character from Input String, store the character in a data item and then compare the current character with the previous one. If the current character doesn't match the previous one, the flow will keep on concatenating and store it in the output data item. Since, the input is a string, it will work for numbers as well as letters or a combination of both. Let me know if you need any help.
------------------------------
Vikrant Sharma
Senior Solution Designer
Blue Prism
------------------------------
Vikrant Sharma
Senior Solution Designer
Blue Prism
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-05-22 07:51 AM
Hi,
I am not able to import that file. please update .bprelease file, that will vey helpful for me.
------------------------------
Hari bp
------------------------------
I am not able to import that file. please update .bprelease file, that will vey helpful for me.
------------------------------
Hari bp
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-05-22 08:05 AM
Hi,
You can use a simple logic as shown below:

Here, first I used 'Split Text By Lines' action from 'Utility - Strings' VBO :


Next, I've iterated over the 'Split Values' collection using a Loop stage which has the following values:

Next, I have used a decision stage to check if my current character exists in a 'Results' (Text) data item or not which initially would be blank:

If the value exists, I simply skip over the iteration otherwise I will add the value to the 'Results' data item:


At the end of the loop stage, I get the following results:

You can find the attached process for more details:
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
You can use a simple logic as shown below:
Here, first I used 'Split Text By Lines' action from 'Utility - Strings' VBO :
Next, I've iterated over the 'Split Values' collection using a Loop stage which has the following values:
Next, I have used a decision stage to check if my current character exists in a 'Results' (Text) data item or not which initially would be blank:
If the value exists, I simply skip over the iteration otherwise I will add the value to the 'Results' data item:
At the end of the loop stage, I get the following results:
You can find the attached process for more details:
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-05-22 09:40 AM
Hi,
With the risk of stating the obvious, did you try to remove the ".txt" extension from the release file name and then tried to import it? I have anyway attached a .zip for the release if that's not the case.
Also, what's the Blue Prism version you're using? The process was built in 7.0.1 so just checking if you're seeing errors because of a low version of Blue Prism.
------------------------------
Vikrant Sharma
Senior Solution Designer
Blue Prism
------------------------------
With the risk of stating the obvious, did you try to remove the ".txt" extension from the release file name and then tried to import it? I have anyway attached a .zip for the release if that's not the case.
Also, what's the Blue Prism version you're using? The process was built in 7.0.1 so just checking if you're seeing errors because of a low version of Blue Prism.
------------------------------
Vikrant Sharma
Senior Solution Designer
Blue Prism
------------------------------
Vikrant Sharma
Senior Solution Designer
Blue Prism
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-05-22 12:36 PM
Hi Sai
We can remove duplicates from string without using Regex, Object and Code Stage.
See below snapshot i have used only 5 stages and by using Left, Right and Len function we can remove duplicates.
I have attached process you can refer.

------------------------------
naveen k
------------------------------
We can remove duplicates from string without using Regex, Object and Code Stage.
See below snapshot i have used only 5 stages and by using Left, Right and Len function we can remove duplicates.
I have attached process you can refer.
//Inside stages code
//Calc stage
//Get First Char, Store in [Temp]
Left([Input], 1)
//Decision Stage
//isCount?
([Count]-1)<Len([Input])
//Decision Stage
//isSame?
[Temp]=Left(Right([Input], Len([Input])-[Count]),1)
//Calc stage
//Append Value, Store in [Unique Number]
[Unique Number]&[Temp]
//Calc stage
//Get Next Char, Store in [Temp]
Left(Right([Input], Len([Input])-[Count]),1)
//Calc stage
//Count++, Store in [Count]
[Count]+1
------------------------------
naveen k
------------------------------
