Thanks Eric. But, although some dates may be six digits and some six digit numbers may be dates, that isn't the case here. ;-)
It is a sequence number that is previously generated/changed to get the records in the correct sequence for reporting. Dennis On Mon, 2 Feb 2004, Eric Edwards wrote: > Date: Mon, 2 Feb 2004 14:14:31 -0600 > From: Eric Edwards <[EMAIL PROTECTED]> > To: Dennis G. Wicks <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > Subject: Re: Need help sorting by specific fields in file. > > Dennis, > Not to tell you how to run your business, but how is the date formatted in > the array? > It has been my experience in working with dates that they should be > formatted as 20040202. This allows you to sort on years that are different. > Eric > ----- Original Message ----- > From: "Dennis G. Wicks" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, February 02, 2004 1:49 PM > Subject: Need help sorting by specific fields in file. > > > > Greetings; > > > > I have a file that I need to sort and currently I am just > > sorting it by > > > > @datalist = sort(@datalist); > > > > but it will eventually have many more records and many of > > them may be quite large, but I only need to sort on the > > first six characters which would be faster. Wouldn't it? > > > > I have looked at perldoc and it shows things like > > > > @articles = sort {$a <=> $b} @files; > > > > but I can't figure out how to tell the sort that $a and $b > > are the first six characters of @datalist. That is numeric > > data BTW. > > > > Any help or pointers appreciated. > > > > Dennis > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>