Elya
April 8, 2019, 2:33pm
1
Hi guys,
I scrapped data from a page this element:
"Associate account manager - via Eric Brant
Start & end date to be defined when selected"
The return line between cant be removed by string.replace(environment.newline,ββ) cause this 2 line are 2 paragraph < p ></ p >
Any idea?
str.Replace(β
β, ββ) to remove it
1 Like
Elya
April 8, 2019, 2:47pm
3
I tried before⦠nothing.
try System.Text.RegularExpressions.Regex.(strvar,"<.*?>",String.Empty)
3 Likes
anil5
(Anil Kumar Bandam)
April 9, 2019, 4:25am
5
Hi @Elya
Use the below expression
system.Text.RegularExpressions.Regex.Replace(str,β\w\nβ,ββ).ToString
Where str is
"Associate account manager - via Eric Brant
Start & end date to be defined when selected"
Refer the below workflow for reference
Main (25).xaml (5.5 KB)
.
1 Like
Elya
April 9, 2019, 8:23am
6
@nadim.warsi @anil5 I tried the both method and this not working.
You can try with a html page with 2 paragraph like this.
< p >Associate account manager - via Eric Brant </ p >
< p >Start & end date to be defined when selected" </ p >
(</ p > I added i space the make this string visible)
anil5
(Anil Kumar Bandam)
April 9, 2019, 8:24am
7
So final string is this only right
After extracting from website can you provide how exactly will be the string
1 Like
Elya
April 9, 2019, 8:28am
8
Associate account manager - via Eric Brant
Start & end date to be defined when selected
anil5
(Anil Kumar Bandam)
April 9, 2019, 8:30am
9
HI @Elya ,
I wanted after extracting the value from webpage, use write line and print this value, i wanted to see how UiPath is printing the value then only a regex can be written for that.
I had used this string in my workflow and provided you the output and if still not working then the issue is with the string.
anil5
(Anil Kumar Bandam)
April 9, 2019, 8:35am
10
nadim.warsi:
β<.*?>β
Use this expression
system.Text.RegularExpressions.Regex.Replace(str,β<.*?>β,ββ).ToString
Where str is the string with p tags
Elya
April 9, 2019, 9:02am
11
I tried before and that doesnβt work. Unfortunately i canβt give the webpage from i get this string. But atleast, there u ll found screenshot.
Before & after (system.Text.RegularExpressions.Regex.Replace(str,β<.*?>β,ββ).ToString)
To Formated Data.xaml (9.5 KB)
Wow , i think the requirement is not to remove the
tag but to remove the html
formatting that happens.
@Elya can you tell me what is the output you are expecting? no new lines?
you need to do a line feed replace
yourString.Replace(Environment.NewLine, String.Empty)
Elya
April 9, 2019, 9:46am
13
It was the first thing I did, and that doesnβt work. It why im here xD
can you help me with the paragraph data, ill hard code for now in your sequence and see how it runs.
Elya
April 9, 2019, 10:05am
15
I canβt provide you the html page. But you try with your own html page containt 2 simple paragraph.
1 Like
Elya,
I have worked through your code and now here is what is the result.
a small tweak to the expression
System.Text.RegularExpressions.Regex.Replace(io_dataFromJobPage("jobDescription"),"\t|\n|\r"," ").ToString
Attaching your xaml with the update.To Formated Data.xaml (10.5 KB)
2 Likes
Elya
April 9, 2019, 11:34am
17
Ty @nadim.warsi @anil5 to participate at this discussion. Finaly the β\t|\n|\rβ expression worked perfectly.
And that will be helpfull for next.
1 Like
system
(system)
Closed
April 12, 2019, 11:35am
18
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.