file1.txt
Washington,Louise,Mary,6,H,193 First St.
Washington,Ann,Carla,1,C,187 10th St.
file2.txt
Child,28,209-568-5177
file1 includes: last name,middle name, first name,# of children,parent code,address
file2 includes: child,age,address
What I'm trying to do is read line one of the file1.txt file if parent code is 'H' then I print that line as is but if parent code is 'C' then I include the information from file1 and go to file2 and retrieve that information for the child which is in the file2 file. So what my output looks like is:
Washington,Louise,Mary,6,H,193 First St.
Washington,Ann,Carla,1,C,187 10th St.,Child,28,209-568-5177
I have to go back to file1 which has infinite number of lines of data and read it and go to file2 only when it's a child and get that information to add to file1.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.