sed 匹配某一行的上一行,然后删除这行最后的换行符。 10
原始文件"1","211.211.222.0","学习(51/1)","21128","2016","60"^M"2","211.111.122.0","学习(9/4)"...
原始文件
"1","211.211.222.0","学习 (51/1)","21128","2016","60"^M
"2","211.111.122.0","学习 (9/4)","22138","2016","60"^M
"4","111.211.333.0","学习 (1/2)
","21515","2016/5/12 0:00:09","60"^M
"8","219.235.141.0","学习 (46/64)","21612","2016","60"^M
"5","211.211.222.0","听课","3202","20169","60"^M
"9","211.211.222.0","听课","4198","2016","60"^M
"7","211.211.222.0","听课","2395","2016","60"^M
"12","111.211.123.0","学习 (9/2)
","111","2016","60"^M
识别","这行的上一行,删除换行符。两行合并
要改成这样
"1","211.211.222.0","学习 (51/1)","21128","2016","60"^M
"2","211.111.122.0","学习 (9/4)","22138","2016","60"^M
"4","111.211.333.0","学习 (1/2)","21515","2016","60"^M
"8","219.235.141.0","学习 (46/64)","21612","2016","60"^M
"5","211.211.222.0","听课","3202","2016","60"^M
"9","211.211.222.0","听课","4198","2016","60"^M
"7","211.211.222.0","听课","2395","2016","60"^M
"12","111.211.123.0","学习 (9/2)","111","2016","60"^M 展开
"1","211.211.222.0","学习 (51/1)","21128","2016","60"^M
"2","211.111.122.0","学习 (9/4)","22138","2016","60"^M
"4","111.211.333.0","学习 (1/2)
","21515","2016/5/12 0:00:09","60"^M
"8","219.235.141.0","学习 (46/64)","21612","2016","60"^M
"5","211.211.222.0","听课","3202","20169","60"^M
"9","211.211.222.0","听课","4198","2016","60"^M
"7","211.211.222.0","听课","2395","2016","60"^M
"12","111.211.123.0","学习 (9/2)
","111","2016","60"^M
识别","这行的上一行,删除换行符。两行合并
要改成这样
"1","211.211.222.0","学习 (51/1)","21128","2016","60"^M
"2","211.111.122.0","学习 (9/4)","22138","2016","60"^M
"4","111.211.333.0","学习 (1/2)","21515","2016","60"^M
"8","219.235.141.0","学习 (46/64)","21612","2016","60"^M
"5","211.211.222.0","听课","3202","2016","60"^M
"9","211.211.222.0","听课","4198","2016","60"^M
"7","211.211.222.0","听课","2395","2016","60"^M
"12","111.211.123.0","学习 (9/2)","111","2016","60"^M 展开
2个回答
追问
这个。用我这个例子写不了啊。 ","这行的上一行没有一样的词。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |