Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: sort utility key specification

by BrowserUk (Patriarch)
on Apr 21, 2012 at 15:14 UTC ( [id://966374]=note: print w/replies, xml ) Need Help??


in reply to Re^3: sort utility key specification
in thread sort utility key specification

They do, until you throw in some negative numbers. They munge the sign into the last character.

Ah yes. That's a pain to deal with.

I'll look into how much work is involved -- there is also the issue of implied decimal points -- relative to the number of times it might get used.

One question. What type character would you use for bcd?

'b' is currently free, though I can see it might be useful for something else. 'd' is used and 'c' isn't particularly mnemonic.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^5: sort utility key specification
by roboticus (Chancellor) on Apr 21, 2012 at 16:57 UTC

    BrowserUk:

    I've not found the implied decimal points to be a problem, as all the files I work with have them at the same position, so the normal string sort with a touch of magic to handle the sign would be adequate.

    I don't really have a preference or a "gut feel" as what character would be easier to remember for this field type. I'd probably have to refer to the help text.

    (I *was* going to suggest EBCDIC sorting in my original response, but you mentioned "real requirements", and I think I've cared about EBCDIC less than 10 times, so I doubt I would ever use it.)

    Update: I thought I'd mention that every time I've dealt with implied decimals in my code, I tend to just treat them as integers anyway. I generally only format them with a period if I'm generating a report. If I'm just creating a summary file in a similar format, I just write them back, and the other application never knows that I just used integers internally.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re^5: sort utility key specification
by davies (Prior) on Apr 21, 2012 at 20:06 UTC

    I remember meeting the issue when punching Cards for Cobol. C is certainly mnemonic to me - perhaps explaining it is all that's needed? Or perhaps everyone wants to forget those days.

    Regards,

    John Davies

      I remember meeting the issue when punching Cards for Cobol. C is certainly mnemonic to me

      That sold it for me. 'c' it is ;)


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://966374]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-24 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found