30-09-23 09:14 AM
I used blueprism to get html code of a website. I used standard string operations like replace and regex etc. to modify the html to get a result like this:
I would like to "trim" every single line of the string and remove the lines that have no characters but I'm not able to do it.
I thought about a regex replace but somehow I can not get the regular expression right. I use the AVO.regex and tried to use some stuff i found on google which seems to work on regex101:
heres the way i built it:
Anyone got an idea how I could manipulate the string?
Answered! Go to Answer.
01-10-23 11:00 AM
I found a solution now:
I make a regex serach for all lines that have content and put them in a collection. Then I juse join lines with that collection and get a string without empty lines. After that I have to rename the collection field because the join lines action expects a collection with that field name.
30-09-23 09:32 AM
I managed to trim every line with
[ ]{2,}
as input for the regex pattern but still can't get rid of the empty lines.
01-10-23 02:32 AM
Hi Marco Matuttis,
1) If you want to just replace new line and append all text you can use Replace([Data1], NewlIne(),"")
Data1=
First Line 09/30/2023
01-10-23 11:00 AM
I found a solution now:
I make a regex serach for all lines that have content and put them in a collection. Then I juse join lines with that collection and get a string without empty lines. After that I have to rename the collection field because the join lines action expects a collection with that field name.