Hi  All,

I am new to Perl and need help to solve this one !

I have a txt file and the contents of the file are as below  :

---------------CONTENTS   OF   TEXT   FILE--------------------------
Abdullah Ahmed Hassan
Trading
Location Ruwi Souk St, Ruwi
Bus Hrs 0930-1300:1630-2200
P.O. Box 197 Ruwi Code 112
Phone 708940
Fax 794156
Key Staff Abdullah Ahmed Hassan
Mohammad Hussain Ahmed Hassan
Irfan Ahmed
Mohammad Asim
Activities :3410
Email : [EMAIL PROTECTED]

Abu Ali Trading & Cont
Est
Location Azaiba
B us H rs 0700-1200; 1500-1900
P.O. Box 1695 C. P. 0. Code 111
Phone 595324
Key Staff K. Sasi, Prop
Ali Suleiman Al Ghubshi, Sponsor
Activities 2700

Abu Al Dahab Trading & Contg
Est
Location 23rd July St, Opp Al Ghobish
Furniture Showroom
Bus Hrs 0800-1300 (Sat-Thu); 1600-1900 (Sat-
Fri)
P.O. Box 1254 Salalah Code 211
Phone 297879
Fax 297879
Key Staff Syed Tajudeen Madani, Gen Mgr
Activities 2660
---------------CONTENTS  OF TEXT FILE--------------------------

The names of three companies as above are:

Abdullah Ahmed Hassan
Trading

Abu Ali Trading & Cont
Est

Abu Al Dahab Trading & Contg
Est


I want the data this way .

-----------DATA WANTED THIS WAY----------------
Abdullah Ahmed Hassan Trading
Location Ruwi Souk St, Ruwi
Bus Hrs 0930-1300:1630-2200
P.O. Box 197 Ruwi Code 112
Phone 708940
Fax 794156
Key Staff Abdullah Ahmed Hassan
Mohammad Hussain Ahmed Hassan
Irfan Ahmed
Mohammad Asim
Activities :3410
Email : [EMAIL PROTECTED]

Abu Ali Trading & Cont Est
Location Azaiba
B us H rs 0700-1200; 1500-1900
P.O. Box 1695 C. P. 0. Code 111
Phone 595324
Key Staff K. Sasi, Prop
Ali Suleiman Al Ghubshi, Sponsor
Activities 2700

Abu Al Dahab Trading & Contg Est
Location 23rd July St, Opp Al Ghobish
Furniture Showroom
Bus Hrs 0800-1300 (Sat-Thu); 1600-1900 (Sat-
Fri)
P.O. Box 1254 Salalah Code 211
Phone 297879
Fax 297879
Key Staff Syed Tajudeen Madani, Gen Mgr
Activities 2660
-----------DATA WANTED THIS WAY----------------

I want PERL to make the name of the company to come in
one line as it has done for all three records.

I request your help solving this.

Regards

Sunish Kapoor

Reply via email to