The initial input file can be 3 GB.
I have a NASTRAN (Finite Element Analysis software) output file which is pre sorted.
The first number in each line represent an element. Element number can be aywhere between 1 to 9999999.
They are not consistent either. The example above was just a simplified example. I would not know
exact element numbering. So I might have 10 lines starting with element ID 12000. The next element id might be 13450 and
I might have 10 lines starting with that number. So I have a huge file, and memory is crucial. I need to have an inteligent algorithm
that goes through each line and finds the lines starting with the same number (which I would not know what they are)
and put only those ones in to an array. I do not need to create different array for each element number. Once I
print the sorted nested array, I can use the same array name and put new lines starting with the same numbers into this array. I am
not sure if I am making sense. But thanks for listening.
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.