Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2937

Passing a GNUplot variable to system(/usr/bin/awk)

X-Received by 10.182.44.166 with SMTP id f6mr11233613obm.44.1434589225249; Wed, 17 Jun 2015 18:00:25 -0700 (PDT)
X-Received by 10.140.28.98 with SMTP id 89mr179965qgy.0.1434589225083; Wed, 17 Jun 2015 18:00:25 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!h15no4778038igd.0!news-out.google.com!k20ni2470qgd.0!nntp.google.com!z60no1836512qgd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.graphics.apps.gnuplot
Date Wed, 17 Jun 2015 18:00:25 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=73.47.254.108; posting-account=xb3W6QoAAADsUTjJxCmH6M8xJ6hlGzO3
NNTP-Posting-Host 73.47.254.108
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <f1dbf443-8220-4a41-bb98-a03c6c71acea@googlegroups.com> (permalink)
Subject Passing a GNUplot variable to system(/usr/bin/awk)
From "Dan'l B" <dan.hinckley@gmail.com>
Injection-Date Thu, 18 Jun 2015 01:00:25 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.graphics.apps.gnuplot:2937

Show key headers only | View raw


This line in GNUplot works fine:

system("/usr/bin/awk '/-1.98/{print $2 $1}' /path/to/myfile.txt")

But how would I pass a variable from GNUplot into that in place of the -1.98 value? 

For example, using STATS_max_y from a plot command:

system("/usr/bin/awk '/STATS_max_y/{print $2 $1}' /path/to/myfile.txt")

That (and its variants) don't work, and I can't work out the formatting to do this correctly.

Back to comp.graphics.apps.gnuplot | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Passing a GNUplot variable to system(/usr/bin/awk) "Dan'l B" <dan.hinckley@gmail.com> - 2015-06-17 18:00 -0700
  Re: Passing a GNUplot variable to system(/usr/bin/awk) Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2015-06-20 01:43 +0200
    Re: Passing a GNUplot variable to system(/usr/bin/awk) "Dan'l B" <dan.hinckley@gmail.com> - 2015-06-20 07:58 -0700

csiph-web