Hi all,
I have a text file which contain space details of oracle Table space in following format.
text file name say: indexlog.txt ****NOTE*** column has multiple space in between*******
--
MCDX 9859393 5678923 3700 12
MCDDXY 78934 34589 3500 23
MCDX_Q1 4589244 456788 3900 45
MCDX_Q2 7601113 4589002 3802 34
MCDDXY_Q1 562004 590022 3400 43
MCDXY_Q2 23012 2202 3900 80
I want to write a perl script to get all the value of record in the following ways -
index-log.pl
-----------
open(FH,"indexlog.txt") || die "could not able to open the file : $!";
while(defined(my $line = <FH>))
{
my ($tbl_spc,$max_size,$free_size,$max_block,$pctfree) = $line=~/^(\w+) \s+ (\d+) \s+ (\d+) \s+ (\d+)$/;
print $tbl_spc,$max_size,"\n";
}
close(FH);
i want to write a regular expression that could read all the column and assign each to variable -- so that i can format it in my own way .
Please suggest what is wrong with this code --as it is not able to assign the column value to the variable at left hand.
when i tried some thing like
$tbl_name = $line=~/^(\w+) (\s+)/; in the script
it is reading the table name into variable.
Thanks
Jam