title: How to set awk variable in gnuplot?
body: <p>Present I can plot in batch like this</p>
  
  <pre><code>filename(n) = sprintf("x0%.3fgammamax.txt", n)
  set term png size 800,600 enhanced
  do for [ii=0:10]{
  tempi=(ii+0.0)
  outfile = sprintf('x0%.3fgammamax-pm3d.png',tempi)
  set output outfile
  splot filename(tempi) notitle with pm3d
  }
  </code></pre>
  
  <p>But, Now I need to process the data before I plot using awk. The content of the file named addblanks.awk is</p>
  
  <pre><code>/^[[:blank:]]*#/ {next} # ignore comments (lines starting with #)
  NF &lt; 3 {next} # ignore lines which don't have at least 3 columns
  $1 != prev {printf "\n"; prev=$1} # print blank line
  {print} # print the line
  </code></pre>
  
  <p>If I don't need dynamic file name, I using the command:</p>
  
  <pre><code>splot "&lt;awk -f addblanks.awk data.txt"  notitle with pm3d
  </code></pre>
  
  <p>However, I need dynamic file name still using awk now. The result should be like:</p>
  
  <pre><code> splot "&lt;awk -f addblanks.awk filename(tempi)"  notitle with pm3d
  </code></pre>
  
  <p>How to get it work?</p>