Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个日志文件,如下所示:
[2013-08-16 03:24:39,192][INFO ][AbstractServiceInvoker [SID:187175558][] Received request of type [ReportNotification]
如果包含 [INFO] 到一个名为 SID 名称的文件,我需要将每行两个写到一个新文件中,例如 187175558_xyz.txt
感谢您的帮助!
这会将输出打印到由 SID 名称定义的 filname
awk -F":|]" '/INFO/ {print $0 >> $6 "_xyz.txt"}' file