I too am unsure as to what your asking, I felt this was worth reply with because I can tell you tried to clearly express your problem. Try cutting out the content from the scripts that you can get working, ask a more targeted question, "Why does this script not do this ________", or a more open-ended question, "How would you do this," but make sure your objective is clearly laid out.

Take notice to the gramatical parsing required by your statement:
If the ids are not the same, I don't want it to write anything to the final file unless one of the ids was blank, but I do want to write them if they are the same, such as:

That writes out as
if (id1 != id2) { !write_to_file unless id1 = '' && unless id1 == id2 } ## WTF!!!!

Which is just as easily written as I want to write to output only if an id is blank or if both correlate to each other
if ( id1 eq id2 || not defined id1 || not defined id2 ) { write_to file() }

Which screams to me, dump both of them in a sql table and do a full outer join
Lol, good luck to you...


Evan Carroll
www.EvanCarroll.com

In reply to Re: Comparing lines of multiple files by EvanCarroll
in thread Comparing lines of multiple files by oomwrtu

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.