我有一个包含数百万行的日志文件:
10.0.7.92 - - [05 / Jun / 2017:03:50:06 +0000]“GET / adserver / html5 / inwapads /?category = [IAB]& size = 320x280& ak = AY1234& output = vast& version = 1.1& sleepAfter =& requester = John& adFormat = preappvideo HTTP / 1.1“200 131” - “”Mozilla / 5.0(Linux; Android 6.0.1; SM-S120VL Build / MMB29M; wv)AppleWebKit / 537.36(KHTML,与Gecko一样)版本/ 4.0 Chrome / 58.0.3029.83 Mobile Safari / 537.36“0.000 1029 520 127.0.0.1
10.0.6.91 - - [05 / Jun / 2017:03:50:06 +0000]“GET /adserver/html5/inwapads/?category=[IAB]&output=vast&version=1.1&sleepAfter =& requester = John& size = 320x280& ak = AY1234& adFormat = preappvideo HTTP / 1.1“200 131” - “”Mozilla / 5.0(Linux; Android 6.0.1; SM-S120VL Build / MMB29M; wv)AppleWebKit / 537.36(KHTML,与Gecko一样)版本/ 4.0 Chrome / 58.0.3029.83 Mobile Safari / 537.36“0.000 1029 520 127.0.0.1
我希望在excel中使用不同列的每一行的打印输出:
inwapads AY1234 john 320x280
如何使用awk或者我需要使用其他方法。
答案 0 :(得分:0)
你使用这样的sed hold模式:
$ sed 's/.*html5\/\(.*\)\/?category.*size=\(.*\)\&ak=\(.*\)\&output.*\.*requester=\(.*\)\&adFormat.*/\1 \3 \4 \2/' inputfile
inwapads AY1234 John 320x280