Thank you for your response! Yes, I have all those typical things at the top, so no problem there. The only data that is coming in that isn't listed, is from the 2009.txt file. The information is two columns: Names of people which becomes the key of the %Diag hash called "$RID" and diagnosis codes that are the values labelled "$DiagCode". I fixed the typo with the file name. It should be "Output by RID".

Now for the technical stuff. So, I understant what you are saying, the $RID should not have a "my" in front of it even though I'm using strict, because that makes it a new variable. Check, removed "my"

I re-opened the file because I was thinking that the script wrote the hash to "Output by RID" then I closed it, then I would reopen it and essentially rename the $DiagCode that were in that file with their technical name using the @Search %Frequency lines. So, I guess that is the wrong way of doing it. Can you please give me a suggestion on how I can import that 2009.txt file into the hash and then rename just the $DiagCode to their technical names using the @Search %frequency?

Finally how would I print everything? Do you just keep appending to the file? As noted in my original question, I need the format to look like the above, but I'm not sure how to merge things. I tried printing a block with EOF, but it didn't work. I tried printing them to different files and merging them, I tried appending the file a bunch of times, but surely there is an easier way! Thanks so much for your help.


In reply to Re^2: Putting Hash values into an array by Raya4505
in thread Putting Hash values into an array by Raya4505

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.