Re: Alphabetical Order



In message <7dd7ace4d%Graeme@xxxxxxxxxxxxxxxxxxxx>
Graeme Wall <Graeme@xxxxxxxxxxxxxxxxxxxx> wrote:

> In message <4dce77c5b0usenet-nospam@xxxxxxxxxxxxxx>
> pv <usenet-nospam@xxxxxxxxxxxxxx> wrote:
>
> > In article <c2bd73ce4d%Graeme@xxxxxxxxxxxxxxxxxxxx>,
> > Graeme Wall <Graeme@xxxxxxxxxxxxxxxxxxxx> wrote:
> > > I have a list of names I want to put into alphabetical order by surname.
> > > What's the best way to go about this?
> >
> > It depends what format the original list is in. Is it in two columns or
> > something? You could probably do it with the aid of !Zap and !Pipedream
> >
>
> That's what I was trying, unfortunately it's a single column.

In !Edit search and replace syntax, you could do a search for

space percent tilde space dollar

and replace with

pipe I query 0 dollar


[Symbols written out in words to ensure correct transmission]

In English, this searches for a space followed by the maximum number of
non-space characters followed by a newline, and replaces each instance with
a tab, then the non-space characters found in the search, then a newline.
That should catch people with apostophes or hypens in their surnames, but
will miss people whose surnames have a space. Fortunately that's very rare
outside Spain and Asia.

I'd do this on a scratch copy if I were you.

That should give you a tab-separated list (TSV) which you can import and
then sort in Fireworkz or something.


If you don't have a suitable spread*** to hand, a second search for

dollar percent tilde pipe I pipe I percent tilde pipe I dollar

replaced with

dollar query 1 pipe I query 0 dollar

will swap the elements on either side of the tab. Either make sure you top
and tail the list with a blank line, or else double-check that the first
and last entries have been processed.


Then you can sort it

Then you can repeat the second search to swap the list back again.

Then you could replace tab with space to get back to the format you started
with. Easy. :-)


In a breach with Usenet tradition, I have tested this and it did work.
Result, as seen in Edit:


Wall[09]Graeme
Peter[09]Young
Bloggs[09]Frederick Aloysius Montmorency



--
Simon Smith

When emailing me, please include the word 'Usenet' in the subject line,
or your message will be deleted unread. Or use my preferred email address,
which is on my web site at http://www.simon-smith.org
.