Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Ok. :-)

Underlying goal is data conversion. I'm processing the output from a (paper) scanning system and trying to convert it into something that's acceptable to our back-end input system. The original paper contains a bunch of mark-sense boxes (think of an SAT or similar test) and just produces a number related to the number of the box.

So, for example, an individual block (bunch of mark sense boxes) will appear in the input data as: "EFD1=1,5,10,".

The (4, 4, 2) refers to the actualy physical layout of those mark-sense boxes. So there are two rows of 4 boxes and one row of 2. In the above case (1,5,10), that means that the first box of the first two rows were marked as well as the second box of the last row.

The 1,5,10 needs to be translated to what they actually "mean", so 1,5,10, needs to turn into (EF01:0, EF02:0, EF03:1). My original idea was to just build an array and index into there (1-1, 5-1, 10-1) and pick out the "right" answer.

The algorithm question that started all this was on better ways to build that array (although, now that you mention it, suggestions on better ways to do this whole thing will also be appreciated :-).

In reply to Re: Re: Clever map / foreach algorithm sought by bmcatt
in thread Clever map / foreach algorithm sought by bmcatt

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2022-05-23 15:15 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (82 votes). Check out past polls.