Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #2945
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail |
|---|---|
| From | Hans-Bernhard Bröker <HBBroeker@t-online.de> |
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: Passing a GNUplot variable to system(/usr/bin/awk) |
| Date | Sat, 20 Jun 2015 01:43:13 +0200 |
| Lines | 15 |
| Message-ID | <cujnoeFgserU1@mid.dfncis.de> (permalink) |
| References | <f1dbf443-8220-4a41-bb98-a03c6c71acea@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.dfncis.de lhWS0wvIKhibgg/Wzhh8OQuD5kQAwVgZOdAO8wCuhu8xs7l6Ka4kOUuk7C |
| Cancel-Lock | sha1:107wY6etwh4M4itjCE40ESSGwvI= |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 |
| In-Reply-To | <f1dbf443-8220-4a41-bb98-a03c6c71acea@googlegroups.com> |
| Xref | csiph.com comp.graphics.apps.gnuplot:2945 |
Show key headers only | View raw
Am 18.06.2015 um 03:00 schrieb Dan'l B:
> 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?
About the most straightforward way would probably be to use gnuplot's
string manipulation functions to construct your awk command line, e.g.
awkcommand = sprintf("/usr/bin/awk '/%f/{print $2 $1}'
/path/to/myfile.txt", STATS_max_y)
system(awkcommand)
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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