Well said.
Unfortunately I cannot provide an actual example.
So here goes:
- I have no control over the incoming data. It will effectively be pasted by someone in a <TEXTAREA>.
- The data lines may contain sporadic empty lines, which are to be ignored.
- There are useless lines and characters before the useful data starts.
- There are useless lines and characters after the useful data ends.
- The first unique point at which a line can be identified as being useful, is that it start with the characters 'Number:'.
This identifier (index) is not at the start of the data.
- The data can be split into 4 sections:
TOP
A set of values with no keys. These are always in the same place relative to each other.
So, in my previous example, you could safely say $result{Name}='Graq';.
There is only one value per line.
- MIDDLE
A set of key-value pairs seperated by a colon and space /: /.
Some lines have 2 key-value pairs on them (never more).
Keys may contain spaces, values may not.
- BOTTOM
- A set of key-value pairs seperated by a colon and space.
One key-value pair per line (see below).
- A set of values. These values correspond to key-value pair in (i).
One value per line (see below).
NB: The first line of (ii) will be on the same line as the last line of (i), seperated by a space.
- END
A single key-value pair (colon and space seperated), where the value may be missing.
Note on lines with multiple key-value pairs:
- The TOP and MIDDLE never mix.
- MIDDLE values may have multiple entries.
- MIDDLE and BOTTOM(i) may overlap.
- BOTTOM(i) and BOTTOM(ii) always overlap.
- BOTTOM(ii) and END never mix.
Please don't ask why this is :(
<a href="http://www.graq.co.uk">Graq</a>
edited by footpad, ~Tue Dec 4 14:42:09 2001 (GMT)
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.