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


Groups > comp.graphics.apps.gnuplot > #2642 > unrolled thread

comparing char variables

Started byKarl <mail.kfr@gmx.net>
First post2014-11-25 11:11 +0100
Last post2014-11-26 23:15 -0800
Articles 5 — 5 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  comparing char variables Karl <mail.kfr@gmx.net> - 2014-11-25 11:11 +0100
    Re: comparing char variables Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2014-11-25 21:32 +0100
    Re: comparing char variables Gavin Buxton <gavinbuxton@gmail.com> - 2014-11-26 06:35 -0800
    Re: comparing char variables RockDoctor <akarley@gmail.com> - 2014-11-26 10:28 -0800
    Re: comparing char variables ab <ab.3942@googlemail.com> - 2014-11-26 23:15 -0800

#2642 — comparing char variables

FromKarl <mail.kfr@gmx.net>
Date2014-11-25 11:11 +0100
Subjectcomparing char variables
Message-ID<m51ket$hre$1@news.rz.uni-karlsruhe.de>
Hi,

i´ve got a (possibly stupid) question:

Is there a way in gnuplot to compare two character variables, i.e. to
find out which one contains a letter coming later in the alphabet?

  Karl

[toc] | [next] | [standalone]


#2643

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2014-11-25 21:32 +0100
Message-ID<cdk7bhFe6esU1@mid.dfncis.de>
In reply to#2642
Am 25.11.2014 um 11:11 schrieb Karl:
> Hi,
>
> i´ve got a (possibly stupid) question:
>
> Is there a way in gnuplot to compare two character variables, i.e. to
> find out which one contains a letter coming later in the alphabet?
>
>    Karl

As there is not even such a thing as a character variable to begin with: 
somewhat obviously no.

[toc] | [prev] | [next] | [standalone]


#2644

FromGavin Buxton <gavinbuxton@gmail.com>
Date2014-11-26 06:35 -0800
Message-ID<fa24387c-5e83-404c-8378-67d492e58f60@googlegroups.com>
In reply to#2642
On Tuesday, November 25, 2014 5:08:30 AM UTC-5, Karl wrote:
> Hi,
> 
> i´ve got a (possibly stupid) question:
> 
> Is there a way in gnuplot to compare two character variables, i.e. to
> find out which one contains a letter coming later in the alphabet?
> 
>   Karl

No such thing as a stupid question. In terms of plotting though gnuplot reads in numbers and not letters, so to answer your question I don't think it is possible. What exactly are you trying to do?

[toc] | [prev] | [next] | [standalone]


#2645

FromRockDoctor <akarley@gmail.com>
Date2014-11-26 10:28 -0800
Message-ID<44b17216-99dc-43dc-8b43-24fa2f53e878@googlegroups.com>
In reply to#2642
On Tuesday, 25 November 2014 10:08:30 UTC, Karl  wrote:
> Hi,
> 
> i´ve got a (possibly stupid) question:
> 
> Is there a way in gnuplot to compare two character variables, i.e. to
> find out which one contains a letter coming later in the alphabet?
> 
>   Karl

If you're trying to sequence the plotting of data files (for example), couldn't you pipe the list of files through "sed" or "awk" (sorry, not a Un*x Gnuru) to get the list ordered by whatever criteria you want, then process that sorted list as it gets piped back out to gnuplot?
I'm pretty sure that gnuplot can pipe commands out to a shell and feed on the (stdout) results ; never needed to use it, but I'm pretty sure I read that in TFM. (My involvement with gnuplot was to try to work out how to replace a closed-source plotting programme at work. I decided it was possible, but never needed to put it into practice.)

[toc] | [prev] | [next] | [standalone]


#2646

Fromab <ab.3942@googlemail.com>
Date2014-11-26 23:15 -0800
Message-ID<0a269d88-a76f-430e-8cfe-ce756f44aa3d@googlegroups.com>
In reply to#2642
Hi,
you can do quick and ugly
c1="a"
c2="b"
system ("awk ' BEGIN{if ( \"".c1."\" > \"".c2."\" ) {print 1} else {print 0}}' " )
--> 0
c1="c"
system ("awk ' BEGIN{if ( \"".c1."\" > \"".c2."\" ) {print 1} else {print 0}}' " )
--> 1

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web