码迷,mamicode.com
首页 > 其他好文 > 详细

awk 提取数字

时间:2018-09-17 22:12:40      阅读:574      评论:0      收藏:0      [点我收藏+]

标签:audio   命令   class   bst   i++   splay   int   style   isp   

echo b1c2d3d1e8f9 | awk ‘
{
     string=$0
     len=length(string)
     for(i=0; i<=len; i++) 
     {
          tmp=substr(string,i,1)
          if(tmp ~ /[1-9]/) 
          { 
              str=tmp
              str1=(str1 str)
         }
     }
     print str1
}‘            

  命令行直接贴入以上代码。

awk 提取数字

标签:audio   命令   class   bst   i++   splay   int   style   isp   

原文地址:https://www.cnblogs.com/sea-stream/p/9665058.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!