Skip to main content
Inspiring
April 29, 2022
Answered

How to remove only first instance of line break

  • April 29, 2022
  • 3 replies
  • 320 views

I use a third party to translate data into Spanish, but the format of my data changes after automatic translation. I’m using a formula to fix the info into the correct format, but one piece is still missing.

The attached image (sample-issue) shows the black text before and after my find/change formula of:

- =^p• ;

This is almost perfect, but it makes an unnecessary line break at the top of the text (red circle in sample image). I’m trying to figure out how to write another formula to remove ONLY the first match of ^p (end of paragraph), but everything I’ve found and tried doesn’t work. I’m pretty sure the formula is using Regex. Can someone please help me with this?

Fyi: I know Find/Change can change multiple returns into single returns, but that has the potential to cause trouble elsewhere in my documents. I believe a formula is my only option here.

This topic has been closed for replies.
Correct answer Red-Temujin

Someone outside this discussion solved this for me. After the first formula, I just needed to find ^(^p) and replace it with nothing.

3 replies

Red-TemujinAuthorCorrect answer
Inspiring
May 2, 2022

Someone outside this discussion solved this for me. After the first formula, I just needed to find ^(^p) and replace it with nothing.

Brad @ Roaring Mouse
Community Expert
Community Expert
April 29, 2022

A simple GREP search would be:

Find: \s*-\s+   (find any space zero or more times; hyphen; any space one or more times)

Replace: \r•\t    (paragraph return; bullet; tab)

restrict the search to just the style of your bullet points and that should do it.

 

Mike Witherell
Community Expert
Community Expert
April 29, 2022

Maybe while searching for 2 hard returns to replace with 1, you could also put a search limitation on it by specifying the paragraph style in the Find Format?

Mike Witherell