本帖最后由 rushm 于 2011-08-25 15:38 编辑 cat aa.txt[code]#Software: Microsoft Internet Information Services 6.0 #Version: 1.0 #Date: 2011-08-15 16:00:01 #Fields: date time cs-method cs-uri-stem cs-uri-query c-ip cs-version cs(User-Agent) cs(Referer) sc-status sc-bytes time-taken 2011-08-15 16:00:01 GET /photos/listalbum.aspx user_id=30392733 66.249.69.71 HTTP/1.1 Mozilla/5.0+(compatible;+Goog...
批量文本处理,最后一列101后都有2个“,”,只有一个“,”的加一个逗号,如果没有的加2个“,”;有2个“,”的不要加 这个用怎么实现?比如 000010,小陈,525,0,101 000011,张三,826,0,101,, 000012,里斯,117,0,101 000013,周五,148,0,101,, 000015,陈其,220,0,101, 000016,严五,141,0,101,, 000017,陈好,722,0,101,, 000018,朱文,322,0,101, 000019,倪在,734,0,101,, 000020,潘文,865,0,101,, 000021,周届,226,0,101, 最后成 00001...
例如 cj2:/sxcj/wulei>ps -ef|grep tran ftest 16086 1 0 Mar 24 - 0:00 transfer_scp2ppip ftest 22034 1 0 Mar 24 - 0:00 transfer_pd2 ftest 41386 22034 0 Mar 24 - 9661:19 transfer_pd2 ftest 46454 16086 0 12:20 - 249:02 transfer_scp2ppip 我怎么awk取最后一列呢 我想要的结果是 transfer_scp2ppip transfer_pd2 transfer_pd2 transfer_scp2ppip 怎么...
drwxr-xr-x 6 root root 4096 Jan 9 09:21 .demo drwxr-xr-x 6 root root 4096 Jan 12 06:31 .demo.&dtFjpw- &enpoPG1Li9U- drwxr-xr-x 6 root root 4096 Jan 12 06:31 .demo.&dtFjpw- &enpoPG1Li9U- a b c (最后一列空格数量不定) awk如何取得最后一列的完整值
本帖最后由 plumdavid 于 2013-08-03 00:08 编辑 使用awk取最后一列值时,返回的值前后都加上了符号.我的代码如下: ip.cfg[code] 1 scdx unit1 192.168.5.253 192.168.86.129 192.168.86.130 2 lzdx unit2 192.168.88.118 192.168.85.113 192.168.85.114[/code]t.sh[code] #!/bin/bash while read A do eval `echo "$A" | awk -F '\t' '{ip1=$5;ip2=$6} END{print "ip1="ip1" ip2="ip2}'` ...
192.168.1.1 - - [13/Jan/2014:12:33:55 +0800] "POST /test/data.php HTTP/1.0" 200 462 "-" "-" "192.168.1.10" 5.058 192.168.1.2 - - [13/Jan/2014:12:33:55 +0800] "POST /test/data.php HTTP/1.0" 200 470 "-" "-" "192.168.1.10" 15.038 192.168.1.3 - - [13/Jan/2014:12:33:55 +0800] "POST /test/data.php HTTP/1.0" 200 519 "-" "-" "192.168.1.10" 5.071 192.168.1.4 - - [13/Jan/2014:12:33:55 +0800] "POST /test/dat...
比如我有一列: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 我想分成三列显示: 1 6 11 2 7 12 3 8 13 4 9 14 5 10 该如何做? 谢谢!
各位大牛好, 有一文件,内容如下: 11111111111|MH@2000004001 11111111111|ISS@2000000003 13002211567|MH@1000000043 13011384877|ISS@2000000000 13012299799|MH@1000000049 11111111111|0001 13001161968|0000 13001384804|0000 13001576208|0000 13001666882|0000 想要合并的结果: 11111111111|MH@2000004001|ISS@2000000003|0001 13002211567|MH@1000000043 13011384877|ISS@2000000000 13012299799|MH@1000000049 1300116...