Ah, someone took the bait :)

I'm not concerned for Perl, but for the next process in the pipeline. It's a data analysis/plotting program I need to feed data to. Some of the plots have a string of numbers in various places, like "25,3,18". This means something if you know that the first field is temperature (25C), the second field is attempt 3, and 18 is the day of the month.

I thought of trying to feed strings instead of numbers, which this system happily accepts. For instance, temperature could be "T=25", and the whole label is more informative. If the label looked like "T=25,A=3,D=18", those with mathaphobia didn't waste precious time working out which is which.

But some of the data have negative values. So "T=-25" sorts after "T=+25". Then some fields have one, two, and three digit values, so "T=10" sorts before "T=5". This can be solved with "T=05". But negative values don't work because of "+" vs. "-".

So I thought of using "N" for negative and "P" for positive. "T=N5" sorts before "T=P5". But "T=N05" sorts before "T=N10"!

My latest thought is to use a sequence number to order the values, because there aren't that many in each field. "0T=-10", "1T=-5", "2T=0", "3T=+5", etc. Since all values are known ahead of time, this encoding can be used to get proper ordering, and field name hints.

Maybe in version 72, this software package will allow a better mechanism for labelling data...

-QM
--
Quantum Mechanics: The dreams stuff is made of


In reply to Re^2: ASCII Woe by QM
in thread ASCII Woe by QM

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.