How to remove only first instance of line break

Explorer ,
Apr 29, 2022 Apr 29, 2022

Copy link to clipboard

Copied

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.

TOPICS
How to

Views

84

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , May 02, 2022 May 02, 2022

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

Likes

Translate

Translate
Community Expert ,
Apr 29, 2022 Apr 29, 2022

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2022 Apr 29, 2022

Copy link to clipboard

Copied

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.

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 02, 2022 May 02, 2022

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines