使用sed查找长度超过120个字符的行 [英] Finding lines which are greater than 120 characters length using sed

查看:38
本文介绍了使用sed查找长度超过120个字符的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取批处理文件中长度超过 120 个字符的行列表.为此,我想到了使用 sed.我尝试过,但没有成功.我怎样才能做到这一点?除了使用 sed 之外,还有其他方法可以获取列表吗?谢谢..

I want to get a list of lines in a batch file which are greater than 120 characters length. For this I thought of using sed. I tried but I was not successful. How can i achieve this ? Is there any other way to get a list other than using sed ?? Thanks..

推荐答案

另一种使用 awk 的方法:

Another way to do this using awk:

cat file | awk 'length($0) > 120'

这篇关于使用sed查找长度超过120个字符的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆