<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 589: Extract metadata from datafiles natively</title><link>https://sourceforge.net/p/gnuplot/feature-requests/589/</link><description>Recent changes to 589: Extract metadata from datafiles natively</description><atom:link href="https://sourceforge.net/p/gnuplot/feature-requests/589/feed.rss" rel="self"/><language>en</language><lastBuildDate>Thu, 15 May 2025 11:01:03 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/gnuplot/feature-requests/589/feed.rss" rel="self" type="application/rss+xml"/><item><title>#589 Extract metadata from datafiles natively</title><link>https://sourceforge.net/p/gnuplot/feature-requests/589/?limit=25#931b</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks, Ethan, for your suggestions. 👍 Those are surely viable solutions. Clearly, I could run gnuplot using WSL and an xserver to be able to use "grep" and I've done that before. However, I was hoping for a &lt;em&gt;genuine gnuplot&lt;/em&gt; solution for all Windows users, i.e., a solution that would also work in Windows cmd.exe where "grep"  is not available and without having to compile gnuplot. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Dan K.</dc:creator><pubDate>Thu, 15 May 2025 11:01:03 -0000</pubDate><guid>https://sourceforge.net83d2fa7df7fe2f4b0c6b381f067c92386f609cdc</guid></item><item><title>#589 Extract metadata from datafiles natively</title><link>https://sourceforge.net/p/gnuplot/feature-requests/589/?limit=25#222c/3271</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;For a simpler case you could just invoke a shell command.  For instance if your data file will somewhere contain a line that begins with the comment character and contains the string &lt;code&gt;Measurement date = &amp;lt;some date&amp;gt;&lt;/code&gt; you could retrieve that line from inside gnuplot like this:&lt;/p&gt;
&lt;p&gt;Data file:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;# example of data file containing metadata as comments
#
# Collection Date = 14 May 2025
# Location = back yard
#
1 5 6   dandelion
2 8 90  weed
3 7 55  rock
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Gnuplot session:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;gnuplot&amp;gt; DATAFILE = 'foo.dat'
gnuplot&amp;gt; QUERY = "grep 'Collection Date = ' " . DATAFILE
gnuplot&amp;gt; TITLE = system(QUERY)
gnuplot&amp;gt;
gnuplot&amp;gt; unset tics; unset border
gnuplot&amp;gt;
gnuplot&amp;gt; set title TITLE
gnuplot&amp;gt; plot DATAFILE using 1:2:4 with labels notitle
gnuplot&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ethan Merritt</dc:creator><pubDate>Wed, 14 May 2025 16:43:30 -0000</pubDate><guid>https://sourceforge.net8e355b85b41a4895577e6a1b152ae94ce8c34bd2</guid></item><item><title>#589 Extract metadata from datafiles natively</title><link>https://sourceforge.net/p/gnuplot/feature-requests/589/?limit=25#222c</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I suggest that you use gnuplot's plugin mechanism load a  function that retrieves the desired information by calling an external library or custom-written program that knows how to interpret JSON or whatever other custom format you like.  There is sample code and a README in the &lt;code&gt;demo/plugin&lt;/code&gt; directory of the gnuplot distribution.  The examples there are for wrapping numerical routines from an external math library and returning a numerical value, but the  same mechanism should work for wrapping a query to a text-handling library and returning a string value.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ethan Merritt</dc:creator><pubDate>Wed, 14 May 2025 16:21:31 -0000</pubDate><guid>https://sourceforge.net92ecd1285eac761a0a490f01f6874abc59a4332f</guid></item><item><title>Extract metadata from datafiles natively</title><link>https://sourceforge.net/p/gnuplot/feature-requests/589/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I usually generate datafiles for gnuplot using an automated test station.&lt;/p&gt;
&lt;p&gt;For documentation purposes, metadata about a test run are stored inside the datafile as comments.&lt;br/&gt;
This metadata can be as simple as the time when the test started. Or it contains parameters that change from test run to test run (e.g., voltage, temperature, ...). Or any important information that pertains to a test and should be stored along with the data. This metadata can be used when creating diagrams for a test report, e.g., to give a diagram an appropriate title.&lt;/p&gt;
&lt;p&gt;Currently, gnuplot does not provide a command to specifically access metadata.&lt;/p&gt;
&lt;p&gt;Thus, I have to use a "hack" as described here: &lt;a href="https://stackoverflow.com/a/72306388/2987152" rel="nofollow"&gt;https://stackoverflow.com/a/72306388/2987152&lt;/a&gt;&lt;br/&gt;
This "hack" uses the &lt;code&gt;stats&lt;/code&gt; command to extract metadata from a datafile.&lt;/p&gt;
&lt;p&gt;I'd like to suggest a feature that allows gnuplot to extract metadata (for example JSON or simple key=value pairs) from datafiles into gnuplot variables.&lt;/p&gt;
&lt;p&gt;Please let me have your comments.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;br/&gt;
Dan&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Dan K.</dc:creator><pubDate>Wed, 14 May 2025 08:58:39 -0000</pubDate><guid>https://sourceforge.net9fc60ed1cd30525d8f37edb9aa8f55e1bf0c2dff</guid></item></channel></rss>