Apologies for the previous "long" message..
The reason I care about the order of the line numbers is that this is the order that the data will be loaded into the new RDBMS. A query is going to loop through the file to obtain result sets based on the values in this file. The target RDBMS (SAP) is configured so that if there is an attempt to load a child object before it's parent then the whole import fails. So, as an example, if you have the following records in a source file, where the record on the left is the child and the one on the right is the parent...
A1-4100-YZX-002|A1-4100
A1-4100|A1
A1-4200-ABC-001|A1-4200
A1-4200|A1
A1-4100-YZX-002-01|A1-4100-YZX-002
In this order the data will not load. What I am trying to do is re-order the same data as....
A1|TOP
A1-4100|A1
A1-4100-YZX-002|A1-4100
A1-4100-YZX-002-01|A1-4100-YZX-002
A1-4200|A1
A1-4200-ABC-001|A1-4200
This would also load....
A1|TOP
A1-4100|A1
A1-4200|A1
A1-4100-YZX-002|A1-4100
A1-4100-YZX-002-01|A1-4100-YZX-002
A1-4200-ABC-001|A1-4200
I don't need to worry about the very,very top number "A1" as this is pre-configured in the target database as the highest-on-high, everything else needs to follow below.
I think that the problem may (and I stress "may") be that within the data, there are "child, father, grandfather" relationships, however, your last statement about the "random" order of the returned hash keys and returning the result set in a specific order by sorting "before" the grep function may be the "key" (sorry for the pun on the word key, couldn't help it)
regards
SlackyB
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.