P
Paul
You can use a port of "sort".Metspitzer said:ThanksOn 07/04/2012 6:07 PM, Metspitzer wrote:
[...]When using a spreadsheet, you have to be careful to specify the cellIt does have dates but sometimes I used the month day year and
sometimes only month and year.
They are listed in chronological order.
format as "date", specify the date format you will use, and never, ever
depart from it. Otherwise, the items won't sort correctly by date.
You can "sort by paragraph" in a word-processor, ie, you end each item
with "Enter", which makes it a paragraph. Place the date at the
beginning, and use leading zeroes, otherwise November 8, 2011 (11-8-12)
will sort before August 4, 2010 (8-4-10). But 11-08-12 will sort
correctly after 02-02-10.
However, if you want to ensure the items are sorted correctly by year,
you'll have to use year-month-day (yyyy-mm-dd).
HTH,
Wolf K.
There is a sort in Coreutils package.
http://gnuwin32.sourceforge.net/packages.html
This is the contents of my download directory.
http://img69.imageshack.us/img69/3088/coreutils.gif
The "...bin.zip" package holds "sort.exe" file.
The "...dep.zip" package has the support DLLs (dependencies) libiconv2.dll and libintl3.dll
The "...doc.zip" package has things like the PDF files.
To work from a Command Prompt window, the three files (.exe and two DLLs)
have to be in the %PATH%. If they're in the same directory as the
data you're working on, then you should be OK then. CD (change directory)
to the folder with both program and data file, and away you go.
Sort works best, if each line can be separated into fields,
and you then tell sort which field to sort on. It can
get quite complicated, getting sort to do a good job. But
if your file has any size at all, it's worth it. And on
modern computers, it takes no time at all to run.
I think Sort has a "unique" option, whereby multiple identical
lines next to each other, can be removed. The Coreutils package
also has a copy of uniq.exe, which will also remove identical lines
from a file.
apple apple
baker --------> baker
baker uniq.exe dog
dog
Of course you're not going to use it, but it's nice to know it's there.
(It's a ported program from Unix/Linux, and I expect, quite old.)
I also have a scripting language, with a "sort" in it, but that's even
more obscure.
*******
Spreadsheets are the way to go with sorting, because then you get your
"columns" in order. To use a spreadsheet, you need a delimiter to separate
the columns. Some people, when preparing lists, use "tab separation" between
each column. And the sorting tools, spreadsheets or programs, can also be
instructed to use the delimiter of your choice. The last time I had some
data to delimit, I used "|" vertical bar, but tabs or commas are also
popular ways to separate the fields.
*******
When you ask a question like this, it helps to provide a couple bogus
example lines you wanted sorted. And then indicate the first field to
sort on, the second field to sort on, and so on. Perhaps you'd want
"date, last name, first name" or somesuch. And then people can see
what kind of tool makes it easy or hard. Computers are not miracle
workers, and if the information is in a variety of formats (like several
kinds of date fields, not just one format), you'd need something pretty
fancy to fix it. (In this example, \t means "tab" character.) This
example would actually be pretty miserable to deal with. A first step,
would be replacing the "," with a tab perhaps, which you might be
able to do in your text editor.
Doe, John \t Dec.05,2012 \t Plumber \t Tulsa
Lou, Mary \t Apr.01,2012 \t Carpenter \t Boise
HTH,
Paul