Nick

You will need a script that 'remembers'.  i.e have a variable $foundProprietor which 
is initially false.  Once you find the line with "Proprietor" on it set the variable 
to true, then process the next line to the output stream and reset Proprietor to false 
again.

Use a similar process to ensure to catch only thr first Identifier. 

Use a regex to match the M5412345.6 construct

<flame bait>
Perl may be a good choice for scripting language
</flame bait>

Regards
John
>>> [EMAIL PROTECTED] 09/27/02 07:48a.m. >>>
I have a series of files with lines like:

Proprietor
Bill Smith and Mary Smith

Identifier  23B/874

M5412345.6 Mortgage to XYZ Bank Limited

each file will have an Identifier and a Proporietor, but not necessarily
a mortgage

I want to process each file and end up with a file like this:

Bill and Mary Smith,23B/874,M5412345.6, XYZ Bank Ltd
John & Joan Brown,23H/123,M123435.6,GHJ Lenders Ltd

The trouble I am having is extracting the proprietor name, as it is on a
different line to the word "Proprietor"

Also the Identifier line appears twice in each file and I only want the
first one.

Can any one help me?
-- 
Nick Rout <[EMAIL PROTECTED]>




**********************************************************************
** This email and attachments have been scanned for content and viruses 
and is believed to be clean **

This email or attachments may contain confidential or legally 
privileged information intended for the sole use of the addressee(s). 
Any use, redistribution, disclosure, or reproduction of this message, 
except as intended, is prohibited. If you received this email in error, 
please notify the sender and remove all copies of the message, 
including any attachments. Any views or opinions expressed in this 
email (unless otherwise stated) may not represent those of Canterbury 
District Health Board
**********************************************************************

Reply via email to