ahhh... So there are not h-starts and h-stops. h(lower case) simply indicates the beginning of a record. My approach would be to find h line and use is as the key in a hash, then iterate until finding each of the subsequent j,E,G lines and adding them as an array under the key(HoA). When you find another h-line, you make a new key and wash,rinse,repeat until end of data. You end up with a structure which is pretty easy to continue to manipulate and do further clean up on if you want to. I am sure there are a bunch of other ways to do this, many better. But what I like about this approach is that it uses well documented data structures which are simple to manipulate. Good luck! Should be fun... :-)
- ...the majority is always wrong, and always the last to know about it...
- The Spice must flow...
- ..by my will, and by will alone.. I set my mind in motion
-
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 How to display code and escape characters
are good places to start.
|