View Single Post
  #10  
Old 06-22-2005, 05:18 PM
tinhat tinhat is offline
Senior Member
 
Join Date: Apr 2005
Location: white courtesy phone
Posts: 288
Default Re: sorting a case sensative list alphabetically

[ QUOTE ]
I have a list of poker notes that i want to sort. each note is seperated by a return. I want to sort them alphabetically by the first word. If the first word is capitalized, it would come before lowercase words.

The list would then look something like this.
A
E
J
W
b
d
o
q

you get the idea. is there a program that will help me do this?

[/ QUOTE ]

If this is a plain text file and you have access to linux (or GNU tools installed on windows), from a csh prompt type what's bolded (where "list" is your text file name):

% mkdir list.tmp && foreach entry (`cat list`)
foreach? touch list.tmp/$entry
foreach? end && ls -1 list.tmp > list.new

"list.new" contains your results.

If you used emacs you'd simply load the file, set "sort-fold-case" to nil and run "sort-lines". Done.

Mike
Reply With Quote