Hello, this is a very naive question from someone who forgot how to use Perl..here is my problem:

i have two tab delimited text files, each one has 2 columns. File 1: line 1: goes | go; line 2: leaves | leave; line 3: sees | see; line 4: eats | eat. And File 2: line 1: went | go; line 2: jumped | jump; line 3: saw | see; line 4: ate | eat.

I need to create File 3, which contains all verbs which are contained BOTH in the 2nd column of file 1 and in the 2nd column of file 2, and combines their information. I would look like this, 3 columns: File 3: line 1: go | goes | went; line 2: see | sees | saw; line 3: eat | eats | ate.

From what I remember there is a very fast way to do it in Perl..but I don't know how..What would be the script which does it?

Thank you!!!!


In reply to script to merge files by marylein

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.