You didn't give us much to work with. I'll try to give you a bit more direction on "how to get started" past reading the tut's.

First, read Markup FAQ to help you format your posts. Of course "Help" as a title is not "helpful" to us.

You don't say what if any programming experience that you have although your post alludes to the idea that you have some other way than Perl to solve this problem.

In general, I would recommend a 3 stage approach:

  1. Write program to read file 1 and parse it correctly
  2. Write program to read file 2 and parse it correctly
  3. Then combine prog1 and prog2 and start making decisions
A basic program #1 could go like this (of course untested as I have nothing to test with):
#!/usr/bin/perl use warnings; use strict; open FILE1, '<', "file1name" or die "input1 error $!"; while (my $line = <FILE1>) { chomp $line; #remove line endings my ($name1,$name2,$name3,$name4,$name5) = split ' ',$line; #use some names that describe what you columns really #mean usually col1, col2 is a bad idea. # put some print statements here to make sure that # you can actually get the 5 individual things }
The most simple version of program 2 is similar, except that since it is a CSV (Comma Separated Value) file, you need a different kind of split.
my ($nameOfNumberfield1, $nameOfNumberfield1, $nameofTextField, $nameofTextfield) =split ',',$line;
This simple approach won't work if there are embedded commas in the text, like: "Bob Smith, Jr.". I don't want to over complicate things if these more complex things are not needed. Program 2 will help you figure out whether this is an issue or not.

Make a stab at the combined program 3 and let us know what issues you are having. If line 5 of input 1 always goes with line 5 of input 2, then this is much easier than a more general situation, but I can't tell from your description what the full requirements are.

I hope that my advice on some of the basics: (a) open the file, (b)basic parsing can get you started? Read about file open and split. Good Luck on your journey, it will require a lot of work.


In reply to Re: Please Help! by Marshall
in thread Please Help! by stockbr

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.