Iren Ramadhan
Iren Ramadhan

Reputation: 339

How to make multiple lines become a single line in BigQuery?

I have a database that has a field containing cells with multiple lines like in the picture below

enter image description here

Instead of separated by an 'enter'/new line, I'd like them to be combined as one line so that I can export them to CSV without any problem.

I've tried using REPLACE(rejection_reason, '\n', '') but it gives me the same output. Is there any workaround on this?

Thank you

Upvotes: 0

Views: 1516

Answers (1)

Nikolay Bogdanov
Nikolay Bogdanov

Reputation: 26

Hmm, REPLACE(rejection_reason, '\n', '') should work well. However, it might be related to Windows-like line separator - \r\n. I would suggest you to try:

REGEXP_REPLACE(rejection_reason, '[\n\r]', '')

Upvotes: 1

Related Questions