I am anxious to use GNUPLOT to graph many "data" records I have which are
embedded as a series inside a larger file with diverse "source" information
about the "run" which produced the "data".
Is there a command I can use in GNUPLOT to Skip the source (I call them
Header) records and just read the "data"? Yes, I can (and sometimes do)
create separate "data" files as output from my program runs but even
when I do I always have some "header information" for them. For the
most important data though, like a baby I keep it as close as possible
to its mother.
Carl Wagner
gnuplot treats all lines that start with a '#' as comments. The
easiest thing to do would be to mark all your 'header information' as
comments, and gnuplot will just skip them.
If you are working on a Unix-like platform, you can also specify an
external filter program that extracts the relevant data from your
file; something like
plot "< filter data.dat"
where 'filter' can be any external program (simply grep, or a
home-made script, or whatever). See 'help datafile special' for more
information.
Hope that helps,
Lutz
> Is there a command I can use in GNUPLOT to Skip the source (I call them
> Header) records and just read the "data"?
Usually, it's enough to just plot the datafile with a full using spec, i.e.
plot 'datafile' using 1:3
or whatever. gnuplot is clever enough to detect lines that don't have numbers
in whitespace-separated column one and three and ignore them. So, as long
as none of your non-data lines start with a number, you're game.
For other cases, see Lutz' answer.
--
Hans-Bernhard Broeker (bro...@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
gnuplot gives you three ways to specify which columns are to be plotted.
All make use of the "using" option. And all treat bad (that is,
unplottable) data differently. So if "plot 'filename'" fails to exclude
your headers, maybe "plot 'filename' using 1:2" will do what you want, or
even "plot 'filename' using ($1):($2)".
Or you can start each header line with gnuplot's comment character, "#",
which will always work.
Dick Crawford, aka craw...@arete.com