Sort and Sorting

Was wondering if there is some way to set up a sort of text such that the chunks being sorted were defined by user defined chunk delimiters strings (example: return&return) such that the following list:

"Love
caring deeply about another

Hate
directed anger

Fear
the feeling of dread

Compassion
the understanding of another’s situation

Indifference
no preference at all

"

would be sorted not as individual words or lines but series of lines separated by double returns.

Desired (ascending alphabetic) sort would yield:

"Compassion
the understanding of another’s situation

Fear
the feeling of dread

Hate
directed anger

Indifference
no preference at all

Love
caring deeply about another"

Have you thought of using Line-feeds Opt-Cmd-Return rather than Returns in your term+definition sets. I think it should treat the whole as a single line internally and therefore permit the sorting you require.

3 Likes

Will try, but sort of defeats the purpose of writing in Scrivener (without paying attention to formatting and special chars.

Keeping multi-line paragraphs together
like that is how most all text editors work.

1 Like

That has nothing to do with formatting or special characters. What you seemed to be proposing would very much involve special characters.

Line-feed is not a “special character“, it’s a way of moving text down to the next line in appearance, but without creating a carriage return which would prevent alphabetisation as you want.

Anyway, up to you.

:slight_smile:
Mark

1 Like

Linefeed very much IS a special character (ASCII 10, \n ).

1 Like

Yes, but saying this doesn’t help me perform the sort I would like to perform.

What @xiamenese and @rms suggested works:

sort_of

EDIT: For clarification, no RegEx etc. required, it’s just Edit → Sort → Ascending in action.

3 Likes