> On May 29, 2023, at 9:20 AM, Kim Mosley <[email protected]> wrote:
> No, that doesn’t work here because there is a \n at the end of every line…
> and it is not soft wrapped. When I do what you suggested I get this:
How much text are you dealing with? Is this a repeating task? Do you have any
control over the original texts you’re working on?
I would try to remove those line-breaks internal to the paragraphs as early in
my processing as possible, or alter the form they come to me in if I can
control that. Each paragraph (which might have multiple sentences) should be on
one line with soft-wrapping off in the text editor (BBEdit).
Here’s a possible hacky approach, from looking at the sample text you posted:
Hacky Step 1: Insert newlines before “paragraphs”:
Search for an uppercase letter at the start of a line:
^([A-Z])
and replace it with:
\n\1
BBEdit has great documentation of the above find/replace expressions, but
briefly,
^ denotes the start of a line;
[A-Z] stands for one character of the range A to Z (uppercase standard English
characters, so I’m making some assumptions here);
() around the [A-Z] “captures" whatever character it found.
In the replace pattern, \n is our friend the newline, and \1 stands for what
was captured in the search pattern - that first character of the line.
That will put a newline “\n” in front of what is likely to be the start of one
of your paragraphs. So you won’t have to do that many times manually. But you
will need to check it over, because this isn’t bullet-proof.
Step 2: Remove internal line breaks:
Once you have those newlines inserted before each set of lines that you
consider a paragraph, you'll want to remove the internal line breaks with the
paragraphs.
After Hacky step 1, your “paragraphs” now have single newlines internally and
are separated by two newlines. So your search for the internal newlines would
be for a “\n" surrounded by space-bar spaces, characters, or punctuation but no
adjacent newlines.
Minimalistic search pattern:
([^\n])\n([^\n])
This finds a \n with any character NOT an \n on either side; the ^ inside the
square brackets means “not”.
Replace with:
\1 \2
This will put the surrounding captured characters back with a spacebar space
between them where the \n was. This might not be exactly what you need,
depending on how those internal line breaks originally got into your
“paragraphs”. Might be some extra spacebar spaces lying around.
So test on a copy of your file. Also turning on BBEdits “Show Invisibles” can
be helpful for this work
— Bruce
_bruce__van_allen__santa_cruz_ca_
> On May 29, 2023, at 9:20 AM, Kim Mosley <[email protected]> wrote:
>
> No, that doesn’t work here because there is a \n at the end of every line…
> and it is not soft wrapped. When I do what you suggested I get this:
>
> The practice of yoga now comes in as a means of actually making this
> detachment from mental
>
> construction a practical possibility. In order that this detachment not
> become nihilistic or otherwise
>
> aberrated, and that altered states of consciousness not merely be substitued
> as objects of fixation,
>
> the doctrine here introduces the principles of the relative and real natures
> of phenomena concealed
>
> beneath the conceptualized description.
>
> The relative or dependent nature is the nature of phenomena as products of
> interactions of
>
> conditions. A generalized example of this commonly used for illustration is
> the interaction of
>
> sense faculties, sense consciousnesses, and sense data. This is the raw
> material of the selection and
>
> organizational process of mental construction. Since the faculties,
> consciousnesses, and data
>
> cannot be apprehended in themselves, outside of their mutual
> interrelationship, there is no way of
>
>
>> On May 29, 2023, at 11:11 AM, Rod Buchanan <[email protected]> wrote:
>>
>>
>> If you are looking to change this
>>
>> this is paragraph 1.
>> this is paragraph 2.
>>
>> to this
>>
>> this is paragraph 1.
>>
>> this is paragraph 2.
>>
>> This search/replace should do it:
>>
>> Search: \n
>> Replace: \n\n
>>
>> Make sure Grep is enabled.
>>
>> HTH,
>>
>> —
>> Rod
>>
>>
>>
>>> On May 29, 2023, at 11:06 AM, Kim Mosley <[email protected]> wrote:
>>>
>>> Thanks Bruce.
>>>
>>> Soft wrapping is off… so I don’t know if this can be fixed other than
>>> manually adding a space after each paragraph.
>>>
>>> --
>>> This is the BBEdit Talk public discussion group. If you have a feature
>>> request or need technical support, please email "[email protected]"
>>> rather than posting here. Follow @bbedit on Twitter:
>>> <https://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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/bbedit/DF48E0AB-FB27-4F14-81B9-8D6D51D35F4D%40gmail.com.
>>> <example.txt>
>>>
>>>> On May 29, 2023, at 10:38 AM, Bruce Van Allen <[email protected]> wrote:
>>>>
>>>>>> if newlines were paragraph separators.
>>>>
>>>>
>>>> It’s easy to find each “\n” and replace it with with “\n\n", to provide
>>>> space between lines, but I have a feeling that’s not what you’re thinking
>>>> of.
>>>>
>>>> Keep in mind that BBEdit is a text editor, not a word processor or page
>>>> layout app. In text, “\n” stands for a newline; but it doesn’t carry any
>>>> of the paragraph formatting that a word processor might provide via “space
>>>> before” or “space after” in its paragraph formatting controls.
>>>>
>>>> When I import text into an app like Affinity Publisher, Adobe InDesign,
>>>> etc, I rely on those apps to provide the paragraph formatting.
>>>>
>>>> Now, another newline issue can be that paragraphs themselves are
>>>> “hard-wrapped”, meaning that “\n" is used WITHIN paragraphs to make the
>>>> lines wrap. In those cases, my goal is usually to remove the “\n”s except
>>>> where I really want to end the line. That’s another easy find/replace op.
>>>> BBEdit provides controls to flip “soft wrapping" on/off, so I can see a
>>>> whole long line wrapped to a viewable width if necessary, but without
>>>> inserting newlines to make it wrap.
>>>>
>>>> But really, I’m guessing here what you both want. Examples?
>>>>
>>>> — Bruce
>>>>
>>>> _bruce__van_allen__santa_cruz_ca_
>>>>
>>>>
>>>>
>>>>> On May 29, 2023, at 7:42 AM, Johnny Ragadoo <[email protected]>
>>>>> wrote:
>>>>> I'd like to learn how to do this, too. BBEdit would be a fantastic
>>>>> companion editor for desktop publishing apps like Affinity Publisher if
>>>>> newlines were paragraph separators.
>>>>
>>>>> On Saturday, May 27, 2023 at 6:40:55 AM UTC-5 Kim Mosley wrote:
>>>>> How do I add a space between paragraphs? It seems every line is showing
>>>>> \n?
>>>>
>>>> --
>>>> This is the BBEdit Talk public discussion group. If you have a feature
>>>> request or need technical support, please email "[email protected]"
>>>> rather than posting here. Follow @bbedit on Twitter:
>>>> <https://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 view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/bbedit/A0DB5110-1BEA-40AF-B73D-88F19ECFA9AB%40cruzio.com.
>>>
>>> --
>>> This is the BBEdit Talk public discussion group. If you have a feature
>>> request or need technical support, please email "[email protected]"
>>> rather than posting here. Follow @bbedit on Twitter:
>>> <https://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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/bbedit/DF48E0AB-FB27-4F14-81B9-8D6D51D35F4D%40gmail.com.
>>
>>
>> --
>> This is the BBEdit Talk public discussion group. If you have a feature
>> request or need technical support, please email "[email protected]"
>> rather than posting here. Follow @bbedit on Twitter:
>> <https://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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/bbedit/B97AB4A5-932D-48EE-A4DA-B0D2F895C10E%40sofstats.com.
>
>
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature
> request or need technical support, please email "[email protected]"
> rather than posting here. Follow @bbedit on Twitter:
> <https://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 view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/B4C0D58D-A103-4AE3-AD1F-BFA1DE12BB1E%40gmail.com.
--
This is the BBEdit Talk public discussion group. If you have a feature request
or need technical support, please email "[email protected]" rather than
posting here. Follow @bbedit on Twitter: <https://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 view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/81F5E4C7-6DAB-4F40-B3A2-E3A3F9822FD5%40cruzio.com.