Replace <br/> in uipath

replace

For International: [If any, list all requested international tables]


by new line

"


For Domestic: [If any, list all requested domestic tables]


For International: [If any, list all requested international tables]



These requested tables are NOT exported correctly:




"

Hi @shilpashree.mohanty can you please clarify the question?

<br//>
For International: [If any, list all requested international tables]
<br//><br//>
Domestic…
from above text, remove
<br//>
For International: [If any, list all requested international tables]
<br//>

Hi @shilpashree.mohanty

Assign activity -> Input = "


For Domestic: [If any, list all requested domestic tables]


For International: [If any, list all requested international tables]



These requested tables are NOT exported correctly:




"

Assign activity -> Output = System.Text.RegularExpressions.Regex.Replace(Input,"For International[\s\S]*?\]",Environment.NewLine)

Let me know if you have any queries
Regards

@vrdabberu
Text actually looks like this,
<br//>
For Domestic: [If any, list all requested domestic tables]
<br//>
For International: [If any, list all requested international tables]
<br//><br//>
These requested tables are NOT exported correctly:
<br//>
<br//>

br// is there but actually is br/
i was unable to paste br/ so typed br//

Hi @shilpashree.mohanty

Do you want to replace all </br> and For International: [If any, list all requested international tables]right. Please specify

Regards

i want to replcae
<br//>
For International: [If any, list all requested international tables]
<br//>

br/ it shd be actually

1 Like

If you only want to remove <br/> as mentioned in your title. Then assigning
strYourText = strYourText.Replace("<br/>","") should work

i want to replace the international line also along with br/
br-> breakline character

@shilpashree.mohanty

From the below text

Input = <br/>
For Domestic: [If any, list all requested domestic tables]
<br/>
For International: [If any, list all requested international tables]
<br/><br/>
These requested tables are NOT exported correctly:
<br/>
<br/>

Required Output

<br/>
For Domestic: [If any, list all requested domestic tables]
<br/>
These requested tables are NOT exported correctly:
<br/>
<br/>

Please correct if I’m wrong.

Regards

yes, this is correct

Hi @shilpashree.mohanty

Assign activity -> Input = "<br/>
                            For Domestic: [If any, list all requested domestic tables]
                            <br/>
                            For International: [If any, list all requested international tables]
                            <br/><br/>
                            These requested tables are NOT exported correctly:
                            <br/>
                            <br/>"

Assign activity -> Output = System.Text.RegularExpressions.Regex.Replace(Input,"\<br\/\>\s*For International[\s\S]*?\]\s*\<br\/\>","")

Let me know if you have any queries
Regards

i tried this,
its not replacing any thing
do i need to initialize a variable with value br?

Hi @shilpashree.mohanty

Can you share the text by keeping it in text file and uploading the text file here.

Regards

its in vdi
here is a snap,
image

Hi @shilpashree.mohanty

Input = "</head>
<body>

<br/>
For Domestic: GLFUNCT
<br/>
For International: [If any, list all requested international tables]
<br/><br/>
These requested tables are NOT exported correctly:
<br/>
<br/>
For Domestic: [If any, Fail Domestic]<br/>

<br/>
You can find the tables here: <a href=""[SharePointLink]"">link</a>. 2068
<br/><br/>
The following errors were encountered during exporting the tables:"

Output = System.Text.RegularExpressions.Regex.Replace(Input,"\<br\/\>\s*For International[\s\S]*?\]\s*\<br\/\>","")

the syntax is working fine at me end with your given input

Uploading the xaml for reference
Sequence11.xaml (7.5 KB)

And for confirmation do you have multiple lines like those.

Regards

only single line with that text

Hi @shilpashree.mohanty

Try this workflow

Regards