in reply to How do i extract 3 variables from each line in a file, and print them to a new file
open OUTFILE, ">out.txt"; open INFILE, "in.txt"; while(<INFILE>){ next unless /(\d{1,3})ms:(\d{1,3})ms:(\d{1,3})ms/; print OUTFILE join(",", ($1, $2, $3) ), "\n"; } close OUTFILE; close INFILE;
|
|---|
| 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 bofh_of_oz (Hermit) on Jul 08, 2005 at 16:22 UTC | |
by davidrw (Prior) on Jul 08, 2005 at 16:28 UTC | |
by bofh_of_oz (Hermit) on Jul 08, 2005 at 16:38 UTC | |
by davidrw (Prior) on Jul 08, 2005 at 16:43 UTC |