先取 raw data , 再用 awk 方式來取要的內容

以下範例有注意到差別嗎?

use awk import csv 如下:

cat login.txt| awk  '{ {split($7,a,":")}print $1,$2 "," $5 a[1] "," $9  }'

result:
[2019-02-01 00:00:00],xxxxxxxxxxxxxxxxxxx,24.27.0.0,2,

 cat login.txt| awk    '{ {split($7,a,":") }  print substr($1,2 ), substr($2,1,8) "," $5 a[1] "," $9 }'


result:
2019-02-01 00:00:00,xxxxxxxxxxxxxxxxxxx,24.27.0.0,2,

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *