Gnuplot columnstacked histogram - line/row count

筅森魡賤 提交于 2019-12-05 15:52:37
Woltan

You can determine the number of columns and rows of your datafile like this:

rows = `awk 'END {print NR}' data.log`
columns = `awk '{if(NR == 1) print NF}' data.log`
print "The maximum number of rows is ", rows, " and the maximum number of columns is ", columns
plot for [i=1:columns] 'data.log' using i notitle

You can achieve the same result without using awk with this approach

rows = `cat data.log | wc -l`
columns = `head data.log -n1 | wc -w`
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!