in reply to How do i extract 3 variables from each line in a file, and print them to a new file
I believe this line should do it:
$_ =~ /(\d+)ms/g; print "$1,$2,$3\n";
UPDATE: I agree with comments since I've got the same result... Here's what worked:
$_ = "3434 34456... 321ms:543ms:45ms"; ($d, $e, $f) = ($_ =~ /(\d+)ms/g); print "$d,$e,$f\n";
--------------------------------
An idea is not responsible for the people who believe in it...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How do i extract 3 variables from each line in a file, and print them to a new file
by fishbot_v2 (Chaplain) on Jul 08, 2005 at 16:30 UTC | |
Re^2: How do i extract 3 variables from each line in a file, and print them to a new file
by davidrw (Prior) on Jul 08, 2005 at 16:22 UTC |
In Section
Seekers of Perl Wisdom