Hi Gurus,
I am parsing through a file and need to print the records in the
following order:
Minky Arora
235 River Drive,
Newton,PA 19073
Here is my code:
!/usr/bin/perl
use strict;
open FILE, "/users/meenaksharora/db.txt" or die"cnt open $!";
my($fname,$lname,$address,$lline,$line,@db);
foreach my $line(<FILE>){
$fname=substr($line,0,10);
$lname=substr($line,10,15);
$address=substr($line,16,25);
$lline=substr($line,59,13);
$fname=~s/\s+/ /;
$lname=~s/\s+/ /;
$address=~s/\s+/ /;
$lline=~s/\s+/ /;
print "$fname $lname\n";
print "$address\n";
print"$lline\n";
}
Now each record as I calculated is of a fixed lenght of 75 chars.I
need some idea as to how to run the Loop to print all such
records.Right now I am only able to print the first record,
Thanks in advance,
Min
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/