From 37667ddec347b051c64d9826f00f60da0d0ad5b7 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Thu, 6 Aug 2009 11:59:38 -0700 Subject: [PATCH] gnuplot driver can parse scientific notation Ignore-this: 9c3fa6a5d1974f806ff6cd587c3af5b5 darcs-hash:20090806185938-0cb85-0d54fd39632f145019e923dc9123bc297bbf37fd.gz --- driveGnuPlots.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/driveGnuPlots.pl b/driveGnuPlots.pl index 5ed761d..4d50e63 100755 --- a/driveGnuPlots.pl +++ b/driveGnuPlots.pl @@ -149,11 +149,14 @@ sub main { my $streamIdx = 0; select((select(STDOUT), $| = 1)[0]); my $xlast = 0; + + # regexp for a possibly floating point, possibly scientific notation number + my $numRE = qr/([-]?[0-9\.]+(?:e[-]?[0-9]+)?)/; while(<>) { chomp; my $line = $_; - foreach my $point ($line =~ /([-]?[0-9\.]+)/g) { + foreach my $point ($line =~ /$numRE/g) { my $buf = $buffers[$streamIdx]; # data buffering (up to stream sample size)