a query returns string like AAA[][]AAA[][][][]BBB[][]BBB . I need to replace the four consecutive carriage returns with a semicolon but not the consecutive two carriage returns. I have tried
replace(STRING,chr(13)||chr(13)||chr(13)||chr(13),';')
but it has no effect. Any help would be appreciated.
Use
CHR(10)on linux/unix systems. On Windows, the carriage returns are composed of two charactersCHR(10)||chr(13). On linux:Since you you can use newlines directly in expressions, you can make it work on all platforms/character sets with newline characters (I would recommend this solution since it’s portable):