Jan 29 12:28:17 torsmtp2 postfix/cleanup[16193]: 5513512078E: warning: header Subject: Well Systems - Project Updated (Published Number 561-639-2188) from unknown[10.40.6.11]; from=<Accounts@example.com> to=<bg2833@work.com> proto=ESMTP helo=<CORE1UI1>
我正在尝试提取信息并创建一个包含以下内容的表:
DATE EMAIL Published Number
Jan 29 12:28:17 bg2833@work.com 561-639-2188
是否可以使用 awk 或 sed 来完成此操作?
到目前为止,我能够做到以下几点
head -n 1 file | awk -F ',' 'BEGIN { print "-----------------------\nDate \tEmail\tPhone\n-----------------------"} { print $1;} END { print "-------------"; }'
输出
-----------------------
Date Email Phone
-----------------------
Jan 29 12:28:17 torsmtp2 postfix/cleanup[16193]: 5513512078E: warning: header Subject: American Ramp Systems - Study Updated (Published Number 888-649-2186) from unknown[10.40.6.11]; from=<Accounts@telmetrics.com> to=<bg2833@att.com> proto=ESMTP helo= <CORE1UI1>
-------------
仍然不确定如何提取日期/发布的号码和电子邮件
谢谢你