title: Gnuplot columnstacked histogram - line/row count
body: <p>I have a data file with an undefined number of entries that looks like this:</p>
  
  <pre><code>A B C D E..
  1 0 2 5 4
  7 4 3 4 1
  8   7 4 0
  7     1 1
  </code></pre>
  
  <p>First row represents working time, than pause and so on in alternating fashion. To visualise this, I plot a columnstacked histograms from it by defining two linestyles with different colours and plotting it via:</p>
  
  <pre><code>plot for [i=1:10] 'data.log' using i notitle
  </code></pre>
  
  <p><strong>But the problem is:</strong> I have to guess the max value of i. How can I get the number of columns the data file has? 
  And when defining the alternating linestyles I need to estimate the max number of lines in order to overwrite the default linestyles for what i use a similar for-loop:</p>
  
  <pre><code>set for [j = 1:1000:2] style line i lc rgb "white"
  set for [j = 2:1000:2] style line i lc rgb "red"
  </code></pre>
  
  <p>Here I need to set the max number lines a column in my data has as the max value for j.</p>
  
  <p>Is there a way to grab these values? Possibly by using built-in features of gnuplot only (for I am not familiar with awk scripting).</p>
  
  <p>Thanks for reading,
  best regards</p>
  
  <p>PS: I'm using Windows</p>