shell脚本 逐行读取文本并且 进行字符串的截取
来源:互联网 发布:mysql 查询死锁语句 编辑:程序博客网 时间:2024/04/30 06:15
<p style="margin: 10px auto; padding-top: 0px; padding-bottom: 0px; font-family: verdana, 'ms song', 宋体, Arial, 微软雅黑, Helvetica, sans-serif; line-height: 21.6px;">例如有个文本文件</p><p style="margin: 10px auto; padding-top: 0px; padding-bottom: 0px; font-family: verdana, 'ms song', 宋体, Arial, 微软雅黑, Helvetica, sans-serif; line-height: 21.6px;">1234 ji</p><p style="margin: 10px auto; padding-top: 0px; padding-bottom: 0px; font-family: verdana, 'ms song', 宋体, Arial, 微软雅黑, Helvetica, sans-serif; line-height: 21.6px;">adfa jiji</p><p style="margin: 10px auto; padding-top: 0px; padding-bottom: 0px; font-family: verdana, 'ms song', 宋体, Arial, 微软雅黑, Helvetica, sans-serif; line-height: 21.6px;">adfasd qqwe</p><p style="margin: 10px auto; padding-top: 0px; padding-bottom: 0px; font-family: verdana, 'ms song', 宋体, Arial, 微软雅黑, Helvetica, sans-serif; line-height: 21.6px;"> // 注意一定要有个回车,这样脚本才会读到最后一行 </p><div></div>
while read typelinedo#get line txttypeInf=$typeline#get type#去除右边第一个空格开始的后边所有字符typetmp=${typeInf%% *}#judge type sameif [ "$typetmp" = "$type" ]thenecho sametype:$typetmp#get countpcount=${typeInf:0-1}fidone < $file
0 0
- shell脚本 逐行读取文本并且 进行字符串的截取
- 逐行读取文本文件的 shell 脚本
- Shell 逐行读取文本中的字符串 处理 并打印到新的文本中
- [shell脚本]逐行处理文本
- 文件逐行读取并进行相关处理的Unix Shell 脚本
- shell 脚本的字符串截取
- Shell脚本的字符串截取
- shell脚本的字符串截取
- shell脚本:字符串的截取
- 一种从unicode文本中逐行读取字符串的方法
- 实现两个文件内容逐行进行对比的shell脚本
- shell学习之逐行读取文本
- Shell脚本截取字符串
- shell脚本字符串截取
- shell脚本字符串截取
- shell脚本截取字符串
- shell脚本截取字符串
- shell脚本截取字符串
- win10配置tomcat7
- MyBatis中Like语句使用方式
- 前端常见面试题(2)
- Windows驱动开发:用C还是C++
- JavaScript 10分钟入门
- shell脚本 逐行读取文本并且 进行字符串的截取
- Can't create handler inside thread that has not called Looper.prepare()
- JAVA中几种集合(List、Set和Map)的区别
- 视差容错
- Android studio错误:IllegalArgumentException: Unable to locate adb
- 编程:等式变换
- 竞品分析和产品分析,你究竟搞清楚了么?
- JavaScript 风格指南/编码规范(Airbnb公司版)
- 搜索框简易处理方式