Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Olaf Schultz Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Question about sprintf Date: Sun, 20 May 2012 21:28:00 +0200 Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: individual.net UvwA0ALW0XG1E0H6WPA+Gwi1Gr3ZE9t7BqerQjeWcJD3raGcmXj74Qr54IMieHrOTX Cancel-Lock: sha1:33pUBz9OnX2PT7JK7a7l5aIVVjA= User-Agent: Thunderbird 2.0.0.18 (X11/20081112) In-Reply-To: Xref: csiph.com comp.graphics.apps.gnuplot:1131 sfeam wrote: > Olaf Schultz wrote: > >> Moin moin, >> >> I'am currently using 4.4 pl0 and want to do something like >> >> plot "foo.dat" u 4:5, "" u 4:5:(sprintf("%8s:%5s",$6,$7)) w labels >> >> where $6 and $7 are string-data, no numerical data. But with %s, >> known from fprint in awk, it does not work. The man-page for sprintf >> didn't helped... > > $6 is shorthand for column(6), which returns a numeric value. > The equivalent for string data is stringcolumn(6), for which > the shorthand is strcol(6) Thanks, that works "" u 4:5:(sprintf("%s_%s",strcol(6),strcol(7))) does exact that, what I want. Greetings, Olaf PS: It's every time a big fun to infect to Excel-bounded colleques with the gnuplot-virus:-)