0

我大约有大量相同架构的文件。有没有办法创建一个缓冲区来显示这些文件的摘要?可能与组织模式?

每个文件的格式为:

q   val    counts
1   0.05   2500
4   0.01   2500
10  0.002  2500
.
.
.
.

这些文件都在各自的文件夹中:

prog
 |
 +fold1
 |  |
 |  ----file1
 +fold2
 |  |
 |  ----file1
 -fold3
    |
    ----file1

我不确定摘要应该得出什么结论。我认为前 3 行 + 每个文件的平均值。

4

1 回答 1

0

展开 Juancho 的评论,在 中org-mode,您可以定义一个 shell 源代码块:

#+begin_src sh :results output raw replace
  for i in /path/to/files/; do
      head -n 3 $i
      # I let you compute the average you want using awk and whatnot
  done
#+end_src

并使用C-c C-c(光标在块中)执行它。

如果您希望以某种特定方式格式化结果,您可能需要阅读有关标头参数的手册。(你可以用任何 org-mode支持的语言来做到这一点。)

于 2012-10-01T07:56:50.940 回答