my $file = <STDIN>; chomp($file); if ($file =~ /\w+\.dat/) { open(DATOS, "$file") or die "error message"; while (<DATOS>) { push(@lines, $_) if /^\d/; } close DATOS; foreach my $line (@lines) { my @fields = split(/\s+/, $line); print "@fields"; # or whatever else you want to do } }
In reply to Re: reg exp
by ChrisS
in thread reg exp
by erickfq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |