On Tue, 17 Sep 2002, pravesh biyaNI wrote:
> hi,,
> here is the log file.. ( a part of it )
>
> T 1018448131 905775
> E 1018448131 905891 172 32869 12 0 2080
> E 1018448131 926173 172 32869 13 0 2240
> E 1018448131 955535 172 32869 14 0 2400
> E 1018448131 955862 172 32869 15 0 2560
> E 1018448131 986499 172 32869 16 0 2720
> E 1018448132 5794 172 32869 17 0 2880
> E 1018448132 27912 172 32869 18 0 3040
> E 1018448132 46918 172 32869 19 0 3200
> E 1018448132 65760 172 32869 20 0 3360
> E 1018448132 85791 172 32869 21 0 3520
> E 1018448132 106231 172 32869 22 0 3680
> T 1018448132 122730
>
>
> now i want to filter each of the row components( seperated by space)
> into a variable and manipulate those variables according to my
> requirement!! but the number of elements in a row are changing.. so this
> is the problem
perldoc -f open
perldoc -f split
#!/usr/bin/perl -w
use strict;
open (YOURLOG, $your_log_file_name) or die "Error: $!\n";
while (<YOURLOG>) {
my @row_elems = split;
# The array @row_elems contains the individual elements
# If the current line is E 1018448131 905891 172 32869 12 0 2080
# $row_elems[0] will contain 'E', $row_elems[1] = 1018448131 ...
}
close (YOURLOG);
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]