【发布时间】:2013-11-12 05:34:51
【问题描述】:
"curl -s http://122.160.230.125:8080/gbod/gb_on_demand.do | head -115 | tail -3" 的输出如下
<li>Balance quota: 78.26 GB</li>
<li>High speed data limit: 80.0 GB</li>
<li>No. of days left in the current bill cycle: 28</li>
而curl -s http://122.160.230.125:8080/gbod/gb_on_demand.do | head -115 | tail -3 | awk '{gsub (/&nbsp;/, " "); gsub (/\<li>/, ""); gsub (/\<\/li>/, " "); print}' 给出了
Balance quota: 78.26 GB
High speed data limit: 80.0 GB
No. of days left in the current bill cycle: 28
如何只提取每行的数字数据?另外,有没有更好的方法来提取这些数据?
【问题讨论】:
-
欢迎来到 StackOverflow.com。请更新您的个人资料以包含您的姓名。然后该名称将显示在您的徽章上,您无需在每个问题中都包含它。如果您完成个人资料,还可以获得徽章。