Skip to main content

How to get rid of unwanted linebreak when looking up text?

  • March 6, 2019
  • 4 replies
  • 96 views

Kim_Trager1
Forum|alt.badge.img+23

I’m looking up some text from a different table (Which is another look up from a 3rd table).
But the look up creates stacked text (I’ve expanded the length of the field - but still stacked)
Is there a way to get rid of all these line breaks and make the text all on one line?

4 replies

Kim_Trager1
Forum|alt.badge.img+23
  • Author
  • Brainy
  • 168 replies
  • March 6, 2019

Never mind all sorted - I didn’t think.
I had applied linebreaks to the 3rd table… Sorry about this question.


Forum|alt.badge.img+5
  • Inspiring
  • 1386 replies
  • March 6, 2019

For any future readers looking over our shoulders, if you do need to remove linebreaks from a text field, you can use this to do so:

SUBSTITUTE(
    {Text},
    '\n',
    ' '
    )

Depending on your source text, that might result in some doubled spaces — if a line of text ends with a space followed by a linebreak, for instance. If so, wrap the preceding formula in another SUBSTITUTE() function and clear out the extra spaces:

SUBSTITUTE(
    SUBSTITUTE(
        {Text},
        '\n',
        ' '
        ),
    '  ',
    ' '
    )

Forum|alt.badge.img+7
  • Inspiring
  • 22 replies
  • December 29, 2022

For any future readers looking over our shoulders, if you do need to remove linebreaks from a text field, you can use this to do so:

SUBSTITUTE(
    {Text},
    '\n',
    ' '
    )

Depending on your source text, that might result in some doubled spaces — if a line of text ends with a space followed by a linebreak, for instance. If so, wrap the preceding formula in another SUBSTITUTE() function and clear out the extra spaces:

SUBSTITUTE(
    SUBSTITUTE(
        {Text},
        '\n',
        ' '
        ),
    '  ',
    ' '
    )

Unfortunately this will remove any formatting.
Any chance a script could be made to solve this?


Forum|alt.badge.img+2
  • New Participant
  • 2 replies
  • March 2, 2023

For any future readers looking over our shoulders, if you do need to remove linebreaks from a text field, you can use this to do so:

SUBSTITUTE(
    {Text},
    '\n',
    ' '
    )

Depending on your source text, that might result in some doubled spaces — if a line of text ends with a space followed by a linebreak, for instance. If so, wrap the preceding formula in another SUBSTITUTE() function and clear out the extra spaces:

SUBSTITUTE(
    SUBSTITUTE(
        {Text},
        '\n',
        ' '
        ),
    '  ',
    ' '
    )

Awesome! That worked for me! ✨