当前位置: 技术问答>linux和unix
有关sed大家一起来作作
来源: 互联网 发布时间:2015-02-18
本文导语: 将名和姓交换位置将名和姓交换位置 Steve Blenheim:238-923-7366:95 Latham Lane, Easton, PA83755:11/12/56:20300 Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500 Igor Chevsky:385-375-8395:3567 PopulusPlace,Caldwell,NJ23875:6/18/68:2340...
将名和姓交换位置将名和姓交换位置
Steve Blenheim:238-923-7366:95 Latham Lane, Easton, PA83755:11/12/56:20300
Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500
Igor Chevsky:385-375-8395:3567 PopulusPlace,Caldwell,NJ23875:6/18/68:23400
Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI23874:3/28/45:245700
Jennifer Cowan:548-834-2348:583LaurelAve.,Kingsville,TX83745:10/1/35:58900
Jon DeLoach:408-253-3122:123 Park St., San Jose, CA 04086:7/25/53:85100
Karen Evich:284-758-2857:23 Edgecliff Place, Lincoln,NB92086:7/25/53:85100
Karen Evich:284-758-2867:23 Edgecliff Place, Lincoln,NB92743:11/3/35:58200
Karen Evich:284-758-2867:23 Edgecliff Place, Lincoln,NB92743:11/3/35:58200
Steve Blenheim:238-923-7366:95 Latham Lane, Easton, PA83755:11/12/56:20300
Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500
Igor Chevsky:385-375-8395:3567 PopulusPlace,Caldwell,NJ23875:6/18/68:23400
Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI23874:3/28/45:245700
Jennifer Cowan:548-834-2348:583LaurelAve.,Kingsville,TX83745:10/1/35:58900
Jon DeLoach:408-253-3122:123 Park St., San Jose, CA 04086:7/25/53:85100
Karen Evich:284-758-2857:23 Edgecliff Place, Lincoln,NB92086:7/25/53:85100
Karen Evich:284-758-2867:23 Edgecliff Place, Lincoln,NB92743:11/3/35:58200
Karen Evich:284-758-2867:23 Edgecliff Place, Lincoln,NB92743:11/3/35:58200
|
这种情况用awk啊
|
cut -d: f1 oldfile > t1
cut -d: f2 oldfile > t2
cut -d: f3-5 oldfile > t3
rm oldfile
paste -d: t1 t2 t3 > oldfile
cut -d: f2 oldfile > t2
cut -d: f3-5 oldfile > t3
rm oldfile
paste -d: t1 t2 t3 > oldfile
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。