选择列(时间格式)gnuplot上的第一个和最后一个元素

时间:2017-07-21 09:15:18

标签: time format gnuplot multiple-columns rows

我正在使用Gnuplot对几个文件执行统计,每个文件都有大量的行和列,其中第一个是时间格式“%H:%M:%S”。我在这里找到了(抱歉,找不到链接)一种轻松完成这个过程的方法,即:

# converts the time string in column COL to a number of seconds
intime(COL) = strptime("%H:%M:%S",strcol(1))

# finds correlation of time (seconds) in col 1 with the value in col 2
startrange0 = strptime("%H:%M:%S","18:46:27")
endrange0 = strptime("%H:%M:%S","23:59:27")

stats [startrange0:endrange0] 'datafile.txt' u (intime(1)):2 prefix "A"
set print outfilename append

我的问题是我必须访问每个文件才能在代码中准确地写出开始和结束时间,而打破一些脚本的自动化。

问题是,有没有办法访问时间列的第一个和最后一个元素(即示例中的“18:46:27”和“23:59:27”),所以它可以从每个文件中读取它吗?

谢谢!

0 个答案:

没有答案