Sort text by chunks

53 views
Skip to first unread message

e2o

unread,
Feb 6, 2025, 1:31:13 PM2/6/25
to BBEdit Talk
Hey there!

Using BBEdit’s built-in tools, is it possible to alphabetically sort chunks of text by non-indented header lines, keeping the indented content together with the non-indented heading? For example

------

BEFORE SORT:

Oranges
Navel
Mandarin
several types

Tomatos
Heirloom
see notes
Cherry

Apples
Honey Crisp
the best
Golden Delicious
not so good

------

AFTER SORT:

Apples
Honey Crisp
the best
Golden Delicious
not so good

Oranges
Navel
Mandarin
several types

Tomatos
Heirloom
see notes
Cherry

------

Thanks!

- eric

Tom Robinson

unread,
Feb 6, 2025, 2:15:10 PM2/6/25
to bbe...@googlegroups.com
You can do something like:

1. replace <return><tab> with ‘x’ (where ‘x’ doesn’t appear in your document)
2. sort the lines
3. replace ‘x’ with <return><tab>

Which you can make into a Text Factory if you’ll be doing it often.

Hold down option when pressing enter or tab in the find dialog to enter that as a search character.

Cheers


--
This is the BBEdit Talk public discussion group. If you have a feature request or believe that the application isn't working correctly, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Mastodon: <https://mastodon.social/@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 bbedit+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bbedit/afba8723-b4bf-4a16-9b58-9b237111053dn%40googlegroups.com.

e2o

unread,
Feb 6, 2025, 2:33:29 PM2/6/25
to BBEdit Talk
Sweet! Thanks!
Reply all
Reply to author
Forward
0 new messages