I want to plot individual blocks from a file separately. I've found that this works:
$ cat test
A
0 0
1 1
B
0 0
1 2
C
0 0
1 3
Then
gnuplot> plot for [i=0:2] 'test' index i with lines title columnhead
gives me three separate lines labeled A,B,C. Perfect.
But I don't know the number of blocks in the file, so I have problems. This answer suggests using stats
to get the number of blocks in a file, but stats
fails with bad data on line 6
(the title, "B", of the second block).
I have control over the input file, so I can format that differently if needed.
How can I plot an arbitrary number of blocks (individually) with automatic titling?