Re: :sort by date

2007-01-11 Thread Arun Easi
On Wed, 10 Jan 2007, Bill McCarthy wrote: On Tue 9-Jan-07 4:12pm -0600, Arun Easi wrote: On Tue, 9 Jan 2007, Bill McCarthy wrote: I thought I knew the unix sort utility fairly well. I'm a bit baffled. I wrote a simple program to generate 1,000 records with just random dates (month 1-12,

Re: :sort by date

2007-01-11 Thread Bill McCarthy
On Thu 11-Jan-07 4:21am -0600, Matthew Winn wrote: On Wed, 10 Jan 2007 12:19:08 -0600, Bill McCarthy wrote: On Tue 9-Jan-07 4:12pm -0600, Arun Easi wrote: Lines with same 3rd field are sorted lexicographically. So, if you have MM/DD/ format, that should be good. If you have DD/MM/,

Re: :sort by date

2007-01-11 Thread Bill McCarthy
On Thu 11-Jan-07 12:55pm -0600, Arun Easi wrote: On Wed, 10 Jan 2007, Bill McCarthy wrote: On Tue 9-Jan-07 4:12pm -0600, Arun Easi wrote: Lines with same 3rd field are sorted lexicographically. So, if you have MM/DD/ format, that should be good. If you have DD/MM/, it cannot be

Re: :sort by date

2007-01-09 Thread Vigil
This works on my admittedly small test set: :%!sort -k3 -t/ You're making several unstated assumptions. (1) The records are already sorted by month and day. I would have thought that, too, but sorting this: 01/04/2007 blah 01/03/2007 blah 12/30/2006 blah 07/05/2003 blah 02/04/2007

Re: :sort by date

2007-01-09 Thread Bill McCarthy
On Tue 9-Jan-07 4:11am -0600, Vigil wrote: This works on my admittedly small test set: :%!sort -k3 -t/ You're making several unstated assumptions. (1) The records are already sorted by month and day. I would have thought that, too, but sorting this: 01/04/2007 blah 01/03/2007

Re: :sort by date

2007-01-09 Thread Arun Easi
On Tue, 9 Jan 2007, Bill McCarthy wrote: On Tue 9-Jan-07 4:11am -0600, Vigil wrote: This works on my admittedly small test set: :%!sort -k3 -t/ You're making several unstated assumptions. (1) The records are already sorted by month and day. I would have thought that, too, but

Re: :sort by date

2007-01-08 Thread Vigil
I have a text file in the format: 01/04/2007,field1,field2,field3 01/03/2007,field1,field2,field3 12/30/2006,field1,field2,field3 etc... I need to sort by date, but the new dates in 2007 are placed first in the sort algorithm. How can I sort by the entire date in the format above? This works

Re: :sort by date

2007-01-08 Thread Bill McCarthy
On Mon 8-Jan-07 6:04pm -0600, Vigil wrote: I have a text file in the format: 01/04/2007,field1,field2,field3 01/03/2007,field1,field2,field3 12/30/2006,field1,field2,field3 etc... I need to sort by date, but the new dates in 2007 are placed first in the sort algorithm. How can I sort

Re: :sort by date

2007-01-05 Thread Tim Chase
I have a text file in the format: 01/04/2007,field1,field2,field3 01/03/2007,field1,field2,field3 12/30/2006,field1,field2,field3 etc... I need to sort by date, but the new dates in 2007 are placed first in the sort algorithm. How can I sort by the entire date in the format above? You can

Re: :sort by date

2007-01-05 Thread Erlend Hamberg
On Friday 05 January 2007 15:47, striker wrote: I have a text file in the format: 01/04/2007,field1,field2,field3 01/03/2007,field1,field2,field3 12/30/2006,field1,field2,field3 etc... I need to sort by date, but the new dates in 2007 are placed first in the sort algorithm. How can I sort

Re: :sort by date

2007-01-05 Thread Gary Johnson
On 2007-01-05, Erlend Hamberg [EMAIL PROTECTED] wrote: On Friday 05 January 2007 15:47, striker wrote: I have a text file in the format: 01/04/2007,field1,field2,field3 01/03/2007,field1,field2,field3 12/30/2006,field1,field2,field3 etc... I need to sort by date, but the new dates

Re: :sort by date

2007-01-05 Thread Bill McCarthy
On Fri 5-Jan-07 1:04pm -0600, Gary Johnson wrote: On 2007-01-05, Erlend Hamberg [EMAIL PROTECTED] wrote: On Friday 05 January 2007 15:47, striker wrote: I have a text file in the format: 01/04/2007,field1,field2,field3 01/03/2007,field1,field2,field3 12/30/2006,field1,field2,field3

Re: :sort by date

2007-01-05 Thread A.J.Mechelynck
Gary Johnson wrote: On 2007-01-05, Erlend Hamberg [EMAIL PROTECTED] wrote: On Friday 05 January 2007 15:47, striker wrote: I have a text file in the format: 01/04/2007,field1,field2,field3 01/03/2007,field1,field2,field3 12/30/2006,field1,field2,field3 etc... I need to sort by date, but the

Re: :sort by date

2007-01-05 Thread Gary Johnson
On 2007-01-05, Bill McCarthy [EMAIL PROTECTED] wrote: On Fri 5-Jan-07 1:04pm -0600, Gary Johnson wrote: On 2007-01-05, Erlend Hamberg [EMAIL PROTECTED] wrote: On Friday 05 January 2007 15:47, striker wrote: I have a text file in the format: 01/04/2007,field1,field2,field3