Dear Monks,
As someone who has started out on using Perl, I am faced with a problem which you may be able to recommend solutions to. It essentially requires pattern matching between two data files.
For example:
In file A i have the following fields of data:
(Name, A, B, C, D,)
(ABB, A1, B1, C1 D1)
(Accor ...)
(Aflac Inc...)
etc... and in File B i may have data which will contain some of the above names although not strictly in the same order or description, e.g.
(Name A, B, C, D)
(Abb A11, B11, C11, D11)
(Accor-plc ...)
(Aflac-Inc...)
Ideally I need to search for these names and copy over the field entries for A B C D from one data file to another.
Can perl do "sounds like" pattern searching and then copy the contents of the array?
Cheers.
Edited by Chady -- fixed formatting.
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.