Re: sort without ignoring hyphens
- From: Uri Guttman <uri@xxxxxxxxxxxxxxx>
- Date: Mon, 31 Mar 2008 03:50:43 GMT
"t" == tc314 <tc314@xxxxxxxxxxx> writes:
t> unsorted:
t> 22
t> 2-2
t> 2-3
t> 23
t> 21
t> linux sort produces:
with what options? i don't get that result
t> 21
t> 22
t> 2-2
t> 23
t> 2-3
i got this which makes more sense as - is earlier in ascii than the
digits. sort defaults to a text sort (same as perl).
2-2
2-3
21
22
23
t> desired sort:
t> 2-2
t> 2-3
t> 21
t> 22
t> 23
t> (in ASCII order: hyphen (ascii 45) then 0-9 (ascii 48-57) then A-Z
t> (ascii 65-90))
that is what linux/unix/gnu sort returns. and perl sort should return
the same thing if you keep it a text sort.
so show a runnable short example of your perl sort with input and output
that shows your results. what you claim above doesn't make sense.
uri
--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
.
- References:
- sort without ignoring hyphens
- From: tc314
- Re: sort without ignoring hyphens
- From: John W. Krahn
- Re: sort without ignoring hyphens
- From: tc314
- sort without ignoring hyphens
- Prev by Date: Re: Interpolate variable in a __DATA__ block
- Next by Date: Re: Interpolate variable in a __DATA__ block
- Previous by thread: Re: sort without ignoring hyphens
- Next by thread: Re: sort without ignoring hyphens
- Index(es):
Relevant Pages
|