Subject: ALPHABETIZE a file in UNIX, How?

From: [email-masked] (John Dulaney)
Date: 1 Feb 1995 17:33:04 GMT

I can't export to a w/p as the crs are all wrong and can't find 
any editor that will alphabetize the lines...I hope there is one.
	Thanks for all help!  Best, John

*    World Wide Wedb HOME PAGE http://xmission.com/~wwwads/mind/logic.html 
*    Catalog E-mailed catalog as text, zipped, UUEncoded. Catalog & More at
*    ftp site xmission.com /pub/users/wwwads/logic.zip       
*    WORLDWIDE SHIPPING-VISA/MasterCard/American Express - Wholesale/Retail  
*    E-mail for catalog and more: [email-masked] - A nice guy in Calif. 
*    WIN $500 (Canad.) vote 4 UR favorate NET STOREFRONT! E-mail 4 details 
*    Plug for friend:Blind or seeing impaired? Ask for a free Scatalog.exe

---

From: "Michael C. Newell" <[email-masked]>
Date: Wed, 1 Feb 1995 14:11:33 -0500 (EST)

Try

	sort < input-file > sorted-file

"man sort" will give you details on how sort works...

Mike

On 1 Feb 1995, John Dulaney wrote:

> Date: 1 Feb 1995 17:33:04 GMT
> From: John Dulaney <[email-masked]>
> To: [email-masked]
> Subject: ALPHABETIZE a file in UNIX, How?
> 

Thanks,

Mike

+--------------------------------------+------------------------------------+
|Mike Newell                           | The opinions expressed herein are  |
|NASA Science Internet Network Systems | my own, and do not necessarily     |
|Sterling Software, Inc.               | reflect those of the NSI program,  |
[email-masked]                | Sterling Software, NASA, or anyone |
|+1-202-434-8954                       | else.                              |
+--------------------------------------+------------------------------------+

---

From: [email-masked] (John Dulaney)
Date: 2 Feb 1995 02:59:00 GMT

THANKS MIKE!!!!
	Best, John

*    FREE shareware & ICONS & CD-ROM disks/hardware/PAL/SECAM video catalog

---

From: JDulaney <[email-masked]>
Date: Wed, 1 Feb 1995 20:32:27 -0800 (PST)

> "man sort" will give you details on how sort works...
--------------------
	Mike, thanks. I also read your note in the newsgroup and have 
thoroughly read the man sort file but I still have a problem.
	I know you're prob. very busy but if you know where I can go?
	The prob. is that I have first lines followed by indented lines. 
They are CD-ROM titles with a few lines of descriptions and price.
	Prob. is I only want the first line of each little paragraph 
sorted by dictionary, not every line. That would put the whole thing into 
a mess and I absolutely need the lines of description.
	Any hope?
	Much thanks and if you're too busy no problem.
	Best, John

---

From: [email-masked] (Dennis Golden)
Date: 2 Feb 1995 12:49:27 -0600

In article <[email-masked]>,
>	Much thanks and if you're too busy no problem.

Just sorting is not going to hack it.  Unix utilities such as awk or the
publicly available perl should handle the task.  In fact, one of the
examples in the original awk book covered this.

Regards,

Dennis

---

From: [email-masked] (John Dulaney)
Date: 3 Feb 1995 15:42:41 GMT

Well...if only some awk genius could help me out here.
	I know nothing about computer languages etc.
	Much appreciated!
	Best, John

---

From: [email-masked] (R. Stewart Ellis)
Date: 6 Feb 95 17:17:34 GMT

>	Thanks for all help!  Best, John

Decent full-function editors for UNIX (I only use jove, Emacs, and jed)
allow you to mark a region and send it to a UNIX filter, in this case sort.
Read the manpage for your editor and for sort.  I believe joe and vi also
allow piping a region to an external command.  Basically if you can imagine
a text tranformation, the basic tools of UNIX can accomplish it.  Get a good
intro book to UNIX.

-- 
  R.Stewart(Stew) Ellis, Assoc.Prof., (Off)810-762-9765   ___________________
  Humanities & Social Science,  GMI Eng.& Mgmt. Inst.    /   _____  ______ 
  Flint, MI 48504      [email-masked]               /        / /  /  / /
  Gopher,chimera,nn,tin,jove,modems, free code is best!/________/ /  /  / /

---

From: [email-masked] (R. Stewart Ellis)
Date: 6 Feb 95 17:24:00 GMT

>	I know nothing about computer languages etc.

The problem is a classic one of not having a normalized datafile.  On UNIX
you could at least give some consideration to treating this as a
bibliography and using the bib tools.  To see addbib and his friends, 
'man -k bib'

People have given you some pointers.  Go check out the books on awk and perl
from your library.

---

From: [email-masked] (Steven de Mena)
Date: 6 Feb 1995 07:02:47 GMT

John Dulaney ([email-masked]) wrote:
: 	Well...if only some awk genius could help me out here.
: 	I know nothing about computer languages etc.
: 	Much appreciated!
: 	Best, John

Try the "sort" command. Read the online manual pages for it to see the 
parameters:  "man sort"

 --
                                   \\\_''/'
::-*-::-*-::-*-::-*-::-*-::-oOO    (/o-o\)    OOo-::-*-::-*-::-*-::-*-::-*-::
:  Steven de Mena - Sysop      o  (.  "  .)  o   Int: [email-masked] :
:  THE CASTLE bbs (96 lines)    \___) ~ (___/    MajorNet: Sysop@TC1        :
:  Los Angeles, CA, USA  BBS: Telnet/199.190.83.2  Modem/(+1) 818.985.6075  :
::-*-::-*-::-*-::-*-::-*-::-*-::-*-::-*-::-*-::-*-::-*-::-*-::-*-::-*-::-*-::