[GIS] Find and Replace ALL function in QGIS field calculator

field-calculatorfindqgisreplace

We are trying to figure out if there is a way to find and replace a "\n" string with the character "-" (hyphen).

Excel does a great job finding and replacing all, but not sure how to do same function in QGIS.

enter image description here

Note that the attribute table contains about 1000 of these strings so it would have to be a function that would look within the string for the \n characters without having to input the specific string by hand, if that makes sense.

Best Answer

You can try with this expression in the field calculator:

regexp_replace( "yourfield", '\\\\n', '-')

This sould replace all the \n substrings with -.