If I read your question correctly, you don't want to "remove that 2nd hard 
return": that's the one you want to keep! All the other ones should go.

So we're searching for all lines with 36 or more characters followed by a 
space (correct?) and a newline, and we will replace them with everything 
except the newline.
In the search&replace box, you can (with the *Grep* checkbox checked) 
search for:
^(.{36,} )\n


and replace it with
\1


(the \1 refers to the >35 characters and the space, but not the newline).

On Monday, October 9, 2017 at 4:01:54 PM UTC+2, Mark C. wrote:
>
> So I'm cleaning up a text file that was converted from a PDF file. One of 
> the problems is that each line break is a hard return.
>
> I'd like to replace those hard returns.
>
> However, at the end of each paragraph, there is also a hard return, so 
> replacing the hard returns will remove all paragraph formatting.
>
> However, the last line in each paragraph is never longer than 35 
> characters.
>
> Is there a way within BBedit to search for [space] [hard return] [any 
> sentence<35 characters [space] [hard return]  and remove that 2nd hard 
> return?
>
> I'm guessing I'll have to learn Sed to accomplish this, but thought I 
> would ask here first.  Thank you.
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to