multiline string

Hello to all,
I have a multiline string like the following:

ABCDEF
Colore lato A: NO
Colore lato B: Colore lato B (+3,00)
Colore lato C: NO
Stampa lato A: Stampa lato A (+7,00)
Stampa lato B: NO
Stampa lato C: NO
blablabla
blablabla

basically I would like to make these changes:

  • Remove all lines starting with ‘Colore’ or ‘Stampa’ and end with ‘NO’
  • Remove the part before “:” lines starting with ‘Colore’ or ‘Stampa’

then the result I would like is the following:

ABCDEF
Colore lato B (+3,00)
Stampa lato A (+7,00)
blablabla
blablabla

For various reasons I can not turn it into array and modify it.

I use regular expressions but I have not found the correct one, you have some idea?

Thank you!

Well, you can use the STRING REPLACE functions to remove items from a string.

You can also use substring functions. Many ways to do this.

Since this is an older thread, have you already found a solution?

If not let us know and we can help you.

Sponsor our Newsletter | Privacy Policy | Terms of Service