Adjusting a text

"Please help, I have an automation that extracts text. The issue is that it extracts it in a very misaligned way as seen in the image.

What I’m looking for is to extract this text and correct it so that it appears in a more linear form, for example, “Hello! My name is Alexis Mendoza. How are you?'”

HI,

Can you try the following expression?

yourString = System.Text.RegularExpressions.Regex.Replace(yourString,"\s+"," ")

Regards,

1 Like

Hi @alexis.mendoza.rpa

inputString = Hello!


                                           My name is

              Alexis Mendoza.                  How are you?

outputString = System.Text.RegularExpressions.Regex.Replace(inputString,"\s+"," ")

Hope it helps!!

1 Like

Hi @alexis.mendoza.rpa

You can use the Simple String Mainpulations for adjsting the text. Check the below expression,

- Assign -> InputString = "Hello!
                                My name is
                           Mahesh        How are you?"
- Assign -> Output = String.Join(" ", InputString.Split(New Char() {}, StringSplitOptions.RemoveEmptyEntries))

Check the below workflow for better understanding,

Hope it helps!!