linux 特殊字符处理 sed awk \047 \001

阅读更多
man ascii

[[email protected] ~52]# cat -T 000000_0|grep 862298034006830|sed 's/\001/||/g'
862298034006830M6820wifi182.114.191.1470149013500000980007
862298034006830\N\N182.114.191.1470149013500000980007
[[email protected] ~53]# cat -T 000000_0|grep 862298034006830|awk -F'\001' 'BEGIN{OFS=" | "}{NF=NF;print}' |head -n 10
862298034006830 | M6820 | wifi | 182.114.191.147 | 0 | 1490 | 135 | 0 | 0 | 0 | 0 | 0 | 980007
862298034006830 | \N | \N | 182.114.191.147 | 0 | 1490 | 135 | 0 | 0 | 0 | 0 | 0 | 980007
[[email protected] ~54]# cat -T 000000_0|grep 862298034006830
862298034006830M6820wifi182.114.191.1470149013500000980007
862298034006830\N\N182.114.191.1470149013500000980007
[[email protected] ~56]# cat -v 000000_0|grep 862298034006830
862298034006830^AM6820^Awifi^A182.114.191.147^A0^A1490^A135^A0^A0^A0^A0^A0^A980007
862298034006830^A\N^A\N^A182.114.191.147^A0^A1490^A135^A0^A0^A0^A0^A0^A980007
[[email protected] ~57]#

总结了一下,sed好像不支持\001这种方式的土人白金,而awk支持,sed 有空看一下man文档再想想有没有别个办法;
也不知道vim有没有方式处理;

你可能感兴趣的:(linux 特殊字符处理 sed awk \047 \001)