Pages

03 January, 2024

How to remove specific characters from select column in Snowflake

I have loaded data into table using copy into from stage file(CSV).
+--------------------------------------------------------------------+--------+
| STRING | RESULT |
+--------------------------------------------------------------------+--------+
| hhhhrerererereNRD\r\n\r\nthe 193how (test) testtest peo\r\n\r\n | 30.00 |
+--------------------------------------------------------------------+--------+



my select query expected output is like below:
+---------------------------------------------------------+--------+
| STRING | RESULT |
+---------------------------------------------------------+--------+
| hhhhrerererereNRDthe 193how (test) testtest peo | 30.00 |
+---------------------------------------------------------+--------+



I have tried following option like :
SELECT
regexp_replace(STRING,'\r\n\r\n','')
FROM test;



It is not producing expected output.

No comments:

Post a Comment

Thanks