Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi, I have two files containing data that i would like to compare. Both files contain key value(common key) that i would like to match and print out. What would be most efficient method of doing a comparison? eg, file1 contains some_data key some_data file2 contains different_data different_data key I opened both files and add one file to array and the other to hash then did comparison based on the key using nested for loops. Would there be better method of comparing? thank you in advance.
Sorry for the lack of clarity in my question. I have a list of all the employee's names in one file and the other fi +le has some names from some department. Input All employee file: John Smith Terry Smith Input Dept file: HR John Smith 6th floor R&D Terry Smith 5th floor I would like output to be if John Smith in Dept file exists in All emp +loyee file, print out his info. Hope that helps clear the question a bit. Thanks for your advice. Will definitely read the how not to ask questi +on :)

In reply to comparing two sets of data by mimiandi

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



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found