【发布时间】:2013-07-04 11:46:01
【问题描述】:
我有两个文件说(file1.dat, file2.dat)
file1.dat contains a line similar to
STR KAPPA2=0 RMAXS=4.2 NDIMIN=0 NOCALC=F IALPHA=0
file2.dat contains
class Fe convergency of s-channel= 0.347E-04
class Sr convergency of s-channel= 0.289E-04
class Bi convergency of s-channel= 0.111E-04
class Pt convergency of s-channel= 0.900E-04
我想获取RMAXS (4.2) 和convergency 的值,然后存储这些值
文件中的值 (say plot), column wise
4.2 0.347E-04
4.2 0.289E-04
4.2 0.111E-04
4.2 0.900E-04
我可以获取单个值(使用 grep 和 awk)但不知道如何将它们存储在
以上格式。
Also is there a way to print the shell variables like `$HOME` or
`$PWD` as the third column in the file (plot).
【问题讨论】:
-
文件间链接记录的关键是什么?
-
@fedorqui:显然这不是
join的问题。我假设file1.dat和file2.dat是单个实验的输出,整个过程将运行一系列实验,覆盖相同的文件并从每次运行中提取值。