Tan has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Pattern Matching
by liz (Monsignor) on Dec 29, 2003 at 15:21 UTC | |
Re: Pattern Matching
by dree (Monsignor) on Dec 29, 2003 at 16:53 UTC | |
Re: Pattern Matching
by CountZero (Bishop) on Dec 29, 2003 at 16:50 UTC | |
Re: Pattern Matching
by TomDLux (Vicar) on Dec 29, 2003 at 17:25 UTC | |
by CountZero (Bishop) on Dec 29, 2003 at 20:13 UTC |
Back to
Seekers of Perl Wisdom