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

Time 选择列(时间格式)gnuplot上的第一个和最后一个元素,time,format,gnuplot,multiple-columns,rows,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

我正在使用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”),以便它可以从每个文件中读取它


谢谢

也许我理解错了:如果您想计算整个文件,为什么需要在
stats
命令中指定范围
[startrange0:endrange0]
?谢谢您的问题,我确实可能不需要在stats命令中使用它,但出于某种原因,如果我删除
startrange0=strtime(%H:%M:%S),“18:46:27”)
行,文件崩溃。此外,最终我需要对文件的范围进行划分(例如,当时间跨越午夜时)