Code stage/Utility that can combine first 2 lines and delete 3rd and 4th lines?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-09-17 05:54 AM
Hello,
I was hoping for a bit of assistance.
I am trying to manipulate some data. I get text and store it into a data item.
It looks like so:
--------------------------
2
September 2017.
Dated 19 August 2017
19 August 2017
---------------------------
I am trying to combine/join the first 2 lines so it looks like (2 September 2017) and delete the other 2 lines.
All 4 lines are variable in value (always dates as text), and so I cannot simply remove the above text with replace function.
I am sure there would be a visual basic/.net code that can achieve this outcome, however lack the knowledge myself.
Regards
Andrew
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-09-17 06:42 AM
I have at least gotten rid of lines 3 and 4 with an instring looking for the ""."" and then obtained left -1 of that instring number value.
Now just need to combine lines 1 and 2 with space between both lines (2 September 2017).
I've heard there should be a regex utility available however in the development environment instance of BP I am working with it doesn't seem to be present.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-09-17 01:22 PM
Split text by line and then loop and then add text together.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-09-17 01:30 PM
No need to use regex or code stage to solve this. Use a multi calculation stage with the following expressions (""Data"" is the name of the data item):
Left([Data], InStr([Data], ""."")) and store result in Data - this removes line 3 and 4
Replace([Data], NewLine(), "" "") and store result in Data - the replaces the new line with a space
