1
我有两个文件。Bash合并文件wihtin两个时间戳(日志文件)
test.log中
sadfsdfdasfasdf
2015-07-07 11:23:33,006 DEBUG : Invoking handleMessage on interceptor [email protected]
name="Demo SG, St. Gallen/*"
domicile="Ottikon"
domicile="Zürich"
domicile="Uster"
name="Luca Gubler"
2015-07-07 15:00:33,008 DEBUG : Invoking handleMessage on interceptor org.apache.cxf.interceptor.
asdfasdfasdfdsgdg
adgasdasdgsdgasdsdg
2015-07-07 16:00:33,008 DEBUG : Invoking handleMessage on interceptor and replace.txt
和replace.txt
2015-07-07 11:23:33,006 DEBUG : Invoking handleMessage on interceptor [email protected]
name="name1"
domicile="domicile1"
domicile="domicile2"
domicile="domicile3"
name="name2"
2015-07-07 15:00:33,008 DEBUG : Invoking handleMessage on interceptor org.apache.cxf.interceptor.
所以我的问题是:我该如何合并我replace.txt文件在我test.log中的文件,以便它只替换replace.txt文件中两个时间戳之间的部分?我正在与bash合作。
感谢
不replace.txt只有时间戳的一个段/范围(ifso为什么不直接使用文本编辑 - 他们是相当便宜;) – amdixon
WOW,我不知道你能使用一个texteditor XD。但我需要这个逻辑来处理我的脚本。该脚本循环遍历目录中的所有日志文件。我想传递一个时间戳作为参数,以便该脚本仅从09:00到10:00取代,例如 – NewJavaPythonDev
因此它是1.您对一个replace.txt运行的多个test.log文件,2。对每个test.log文件使用multilple replace.txt或者3.完全不同的东西 – amdixon